diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-11 19:06:27 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-11 19:06:27 +0000 |
commit | f83d0466afc32542f3f4ff962105c817a1be2c96 (patch) | |
tree | c6b9e2b0b9002baf4b6f2cabb982dd0820cceba6 /thrpool.c | |
parent | daab757f5e52ce36a47e2d713365d68367a0e6dd (diff) | |
download | cmogstored-f83d0466afc32542f3f4ff962105c817a1be2c96.tar.gz |
We want to yield dying threads as soon as possible during thread shutdown, so we check the quit flag and yield the running thread to trigger a MOG_NEXT_ACTIVE.
Diffstat (limited to 'thrpool.c')
-rw-r--r-- | thrpool.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -66,6 +66,12 @@ void mog_thr_test_quit(void) } } +bool mog_thr_prepare_quit(void) +{ + /* no barriers or atomic instructions, this is just a hint */ + return !!mog_do_quit; +} + /* * we no longer rely on pthreads cancellation, so our explicit checks for * thread quitting requires us to continuously signal a thread for death |