diff options
Diffstat (limited to 'src/core/reap.c')
| -rw-r--r-- | src/core/reap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/reap.c b/src/core/reap.c index 3f182205..f996695d 100644 --- a/src/core/reap.c +++ b/src/core/reap.c @@ -18,9 +18,9 @@ static nni_reap_list *reap_list = NULL; static nni_thr reap_thr; static bool reap_exit = false; -static nni_mtx reap_mtx = NNI_MTX_INITIALIZER; +static nni_mtx reap_mtx = NNI_MTX_INITIALIZER; static bool reap_empty; -static nni_cv reap_work_cv = NNI_CV_INITIALIZER(&reap_mtx); +static nni_cv reap_work_cv = NNI_CV_INITIALIZER(&reap_mtx); static nni_cv reap_empty_cv = NNI_CV_INITIALIZER(&reap_mtx); static void @@ -90,14 +90,17 @@ nni_reap(nni_reap_list *rl, void *item) nni_mtx_unlock(&reap_mtx); } -void -nni_reap_drain(void) +bool +nni_reap_sys_drain(void) { + bool result = false; nni_mtx_lock(&reap_mtx); while (!reap_empty) { + result = true; nni_cv_wait(&reap_empty_cv); } nni_mtx_unlock(&reap_mtx); + return (result); } int |
