aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_task.h15
-rw-r--r--sys/sys/taskqueue.h2
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/sys/_task.h b/sys/sys/_task.h
index 2a51e1b07b97..c3f94323ebd2 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_ */
diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h
index bf2e4ee31d0d..2490deb3c0f7 100644
--- a/sys/sys/taskqueue.h
+++ b/sys/sys/taskqueue.h
@@ -56,7 +56,6 @@ int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri,
int taskqueue_enqueue(struct taskqueue *queue, struct task *task);
void taskqueue_drain(struct taskqueue *queue, struct task *task);
void taskqueue_free(struct taskqueue *queue);
-void taskqueue_run(struct taskqueue *queue);
void taskqueue_block(struct taskqueue *queue);
void taskqueue_unblock(struct taskqueue *queue);
int taskqueue_member(struct taskqueue *queue, struct thread *td);
@@ -75,6 +74,7 @@ void taskqueue_thread_enqueue(void *context);
(task)->ta_priority = (priority); \
(task)->ta_func = (func); \
(task)->ta_context = (context); \
+ (task)->ta_running = NULL; \
} while (0)
/*