diff options
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/_task.h | 3 | ||||
-rw-r--r-- | sys/sys/taskqueue.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/_task.h b/sys/sys/_task.h index f459c23..4eb6d64 100644 --- a/sys/sys/_task.h +++ b/sys/sys/_task.h @@ -45,6 +45,9 @@ struct task { int ta_priority; /* priority of task in queue */ 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_ */ diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index 355f1ce..31bd9f2 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -51,6 +51,7 @@ struct taskqueue *taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); +void taskqueue_drain(struct taskqueue *queue, struct task *task); struct taskqueue *taskqueue_find(const char *name); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); @@ -69,6 +70,7 @@ void taskqueue_thread_enqueue(void *context); (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ + (task)->ta_flags = 0; \ } while (0) /* |