summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/thread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/thread.c b/src/core/thread.c
index 74a434f9..bccb4ff3 100644
--- a/src/core/thread.c
+++ b/src/core/thread.c
@@ -86,14 +86,14 @@ static void
nni_thr_wrap(void *arg)
{
nni_thr *thr = arg;
- int stop;
+ int start;
nni_plat_mtx_lock(&thr->mtx);
- while (((stop = thr->stop) == 0) && (thr->start == 0)) {
+ while (((start = thr->start) == 0) && (thr->stop == 0)) {
nni_plat_cv_wait(&thr->cv);
}
nni_plat_mtx_unlock(&thr->mtx);
- if ((!stop) && (thr->fn != NULL)) {
+ if ((start) && (thr->fn != NULL)) {
thr->fn(thr->arg);
}
nni_plat_mtx_lock(&thr->mtx);