diff options
author | mdf <mdf@FreeBSD.org> | 2010-07-22 16:41:09 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2010-07-22 16:41:09 +0000 |
commit | fa23fa820ab654dffda5fdb3a938f75cf77b3646 (patch) | |
tree | 3a37e0a8990ba91718b1b54ff6cb60d91c9caa49 /sys/sys/_task.h | |
parent | f6fa9f4a32c433b96c8e6546a8d2f762455f9055 (diff) | |
download | FreeBSD-src-fa23fa820ab654dffda5fdb3a938f75cf77b3646.zip FreeBSD-src-fa23fa820ab654dffda5fdb3a938f75cf77b3646.tar.gz |
Fix taskqueue_drain(9) to not have false negatives. For threaded
taskqueues, more than one task can be running simultaneously.
Also make taskqueue_run(9) static to the file, since there are no
consumers in the base kernel and the function signature needs to change
with this fix.
Remove mention of taskqueue_run(9) and taskqueue_run_fast(9) from the
taskqueue(9) man page.
Reviewed by: jhb
Approved by: zml (mentor)
Diffstat (limited to 'sys/sys/_task.h')
-rw-r--r-- | sys/sys/_task.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/sys/_task.h b/sys/sys/_task.h index 2a51e1b..c3f9432 100644 --- a/sys/sys/_task.h +++ b/sys/sys/_task.h @@ -36,15 +36,20 @@ * taskqueue_run(). The first argument is taken from the 'ta_context' * field of struct task and the second argument is a count of how many * times the task was enqueued before the call to taskqueue_run(). + * + * List of locks + * (c) const after init + * (q) taskqueue lock */ typedef void task_fn_t(void *context, int pending); struct task { - STAILQ_ENTRY(task) ta_link; /* link for 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 */ + struct task **ta_running; /* (q) queue's running task pointer */ + STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ + u_short ta_pending; /* (q) count times queued */ + u_short ta_priority; /* (c) Priority */ + task_fn_t *ta_func; /* (c) task handler */ + void *ta_context; /* (c) argument for handler */ }; #endif /* !_SYS__TASK_H_ */ |