aboutsummaryrefslogtreecommitdiff
path: root/src/core/taskq.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-02-18 19:24:15 -0800
committerGarrett D'Amore <garrett@damore.org>2017-02-18 19:25:14 -0800
commit2944f3a2634876e543003fabb05cba1b178df6aa (patch)
treea9a5aba5aec0ff1028e1a4d5815939887d406bb5 /src/core/taskq.h
parentf42f22abf488d30d4d68a8ab57063c48d618948d (diff)
downloadnng-2944f3a2634876e543003fabb05cba1b178df6aa.tar.gz
nng-2944f3a2634876e543003fabb05cba1b178df6aa.tar.bz2
nng-2944f3a2634876e543003fabb05cba1b178df6aa.zip
Taskq implementation.
Diffstat (limited to 'src/core/taskq.h')
-rw-r--r--src/core/taskq.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/taskq.h b/src/core/taskq.h
new file mode 100644
index 00000000..dc1f4f2d
--- /dev/null
+++ b/src/core/taskq.h
@@ -0,0 +1,32 @@
+//
+// Copyright 2017 Garrett D'Amore <garrett@damore.org>
+//
+// This software is supplied under the terms of the MIT License, a
+// copy of which should be located in the distribution where this
+// file was obtained (LICENSE.txt). A copy of the license may also be
+// found online at https://opensource.org/licenses/MIT.
+//
+
+#ifndef CORE_TASKQ_H
+#define CORE_TASKQ_H
+
+#include "core/nng_impl.h"
+
+struct nni_taskq_ent {
+ nni_list_node tqe_node;
+ void * tqe_arg;
+ nni_cb tqe_cb;
+ nni_taskq * tqe_tq;
+};
+
+extern int nni_taskq_init(nni_taskq **, int);
+extern void nni_taskq_fini(nni_taskq *);
+
+extern int nni_taskq_dispatch(nni_taskq *, nni_taskq_ent *);
+extern int nni_taskq_cancel(nni_taskq_ent *);
+extern void nni_taskq_ent_init(nni_taskq_ent *, nni_cb, void *);
+
+extern int nni_taskq_sys_init(void);
+extern void nni_taskq_sys_fini(void);
+
+#endif // CORE_TASKQ_H