diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-16 14:12:29 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-16 21:08:55 -0700 |
| commit | eab6a4d2d96d11d3926e927c135362fc166895f0 (patch) | |
| tree | b4f8097c339856a1bd12db6d1975fe1b7b951b4b /src/core/taskq.h | |
| parent | ec84c5a8406bb203d5f8830e280f93cf1f63cd6a (diff) | |
| download | nng-eab6a4d2d96d11d3926e927c135362fc166895f0.tar.gz nng-eab6a4d2d96d11d3926e927c135362fc166895f0.tar.bz2 nng-eab6a4d2d96d11d3926e927c135362fc166895f0.zip | |
fixes #445 crash in taskq_thread
This changes the array of flags, which was confusing, brittle, and
racy, into a much simpler reference (busy) count on the task structures.
This allows us to support certain kinds of "reentrant" dispatching,
where either a synchronous or asynchronous task can reschedule / dispatch
itself. The new code also helps reduce certain lock pressure, as a bonus.
Diffstat (limited to 'src/core/taskq.h')
| -rw-r--r-- | src/core/taskq.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/taskq.h b/src/core/taskq.h index 918c6705..8328e4eb 100644 --- a/src/core/taskq.h +++ b/src/core/taskq.h @@ -31,13 +31,12 @@ extern void nni_task_dispatch(nni_task *); // doubt, use nni_task_dispatch instead.) extern void nni_task_exec(nni_task *); -// nni_task_prep and nni_task_unprep are used by and exclusively for the aio -// framework. nni_task_prep marks the task as "scheduled" without actually +// nni_task_prep is used by and exclusively for the aio framework. +// nni_task_prep marks the task as "scheduled" without actually // dispatching anything to it yet; nni_task_wait will block waiting for the // task to complete normally (after a call to nni_task_dispatch or -// nni_task_exec), or for nni_task_unprep to be called. +// nni_task_exec). extern void nni_task_prep(nni_task *); -extern void nni_task_unprep(nni_task *); extern void nni_task_wait(nni_task *); extern int nni_task_init(nni_task **, nni_taskq *, nni_cb, void *); |
