summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2013-02-19 13:58:59 +0100
committerYorhel <git@yorhel.nl>2013-02-19 13:58:59 +0100
commit9e92e5dd9c9a5b2ecf221a05180a7db8a9be650e (patch)
tree27588c8530871cd84d6b1bfeeb1dbcdf6ce42414
parent5a6248fb3501de36a6c6743d000ecde82d9ff592 (diff)
evtp: Improved documentation for evtp_submit()
-rw-r--r--evtp.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/evtp.h b/evtp.h
index 4ea69df..2a35e78 100644
--- a/evtp.h
+++ b/evtp.h
@@ -66,10 +66,15 @@ struct evtp_work_t {
evtp_t *evtp_create(EV_P_ int maxthreads);
-/* Submit work to the thread pool. work_func() will be called in a worker
- * thread. A short while after work_func() returns, done_func() will be called
- * in the thread that runs ev_run() on the main loop given to evtp_create().
- * The *work data must remain valid until done_func() is called.
+/* Submit work to the thread pool. Returns -1 if pthread_create() failed and we
+ * have no threads running (fatal), 0 if pthread_create() failed but we still
+ * have a worker thread (recoverable), or 1 if everything went fine.
+ *
+ * work_func() will be called in a worker thread. A short while after
+ * work_func() returns, done_func() will be called in the thread that runs
+ * ev_run() on the ev loop given to evtp_create().
+ *
+ * The *work object must remain valid until done_func() is called.
*/
int evtp_submit(evtp_work_t *work, evtp_t *evtp, evtp_func_t work_func, evtp_func_t done_func);