diff options
author | sam <sam@FreeBSD.org> | 2005-04-24 16:52:45 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-04-24 16:52:45 +0000 |
commit | 0f63abff2a842df0f9b53a6a11bf2ad4d38b4e00 (patch) | |
tree | 5a6fe7fb2312cf12d5ca0ea2b9d79549f4f97743 /sys/sys/_task.h | |
parent | f09f100e44ebd0ea91f000f67d2a7c8c9d3a4859 (diff) | |
download | FreeBSD-src-0f63abff2a842df0f9b53a6a11bf2ad4d38b4e00.zip FreeBSD-src-0f63abff2a842df0f9b53a6a11bf2ad4d38b4e00.tar.gz |
o eliminate modification of task structures after their run to avoid
modify-after-free races when the task structure is malloc'd
o shrink task structure by removing ta_flags (no longer needed with
avoid fix) and combining ta_pending and ta_priority
Reviewed by: dwhite, dfr
MFC after: 4 days
Diffstat (limited to 'sys/sys/_task.h')
-rw-r--r-- | sys/sys/_task.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/sys/_task.h b/sys/sys/_task.h index 4eb6d64..2a51e1b 100644 --- a/sys/sys/_task.h +++ b/sys/sys/_task.h @@ -41,13 +41,10 @@ typedef void task_fn_t(void *context, int pending); struct task { STAILQ_ENTRY(task) ta_link; /* link for queue */ - int ta_pending; /* count times queued */ - int ta_priority; /* priority of task in queue */ + u_short ta_pending; /* count times queued */ + u_short ta_priority; /* Priority */ task_fn_t *ta_func; /* task handler */ void *ta_context; /* argument for handler */ - int ta_flags; /* Flags */ }; -#define TAF_PENDING 0x1 /* Task is being run now */ - #endif /* !_SYS__TASK_H_ */ |