eventset_stop()
#include "eventset.h"
err_t eventset_stop(EVENTSET *evs)
The eventset_stop()
function
sets a flag and returns immediately. The effect of this is to
instruct the worker thread
to quit.
The worker thread spends
most of its time inside the "main loop", which is
implemented inside eventset_wait()
.
When eventset_wait()
notices that
this stop flag is set, it returns. On return from eventset_wait()
, the worker thread would normally
tidy up and return. Note that, because eventset_stop()
returns immediately, if you want to be sure that all of those
threads have actually stopped, you must wait until the worker thread has completed
(for example, by calling pthread_join()).
eventset()
returns NULL if
successful, or non-NULL otherwise. If non-NULL, the err_t
object contains error strings
which may be printed or otherwise communicated to the user.