From 2b9efcec3f570e069dd6cc4928bfd5c4ff5a1f12 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 26 Jun 2014 15:12:16 +0800 Subject: [PATCH] revert --- skynet-src/skynet_start.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skynet-src/skynet_start.c b/skynet-src/skynet_start.c index fc34a077..c101da30 100644 --- a/skynet-src/skynet_start.c +++ b/skynet-src/skynet_start.c @@ -127,11 +127,11 @@ _worker(void *p) { if (q == NULL) { CHECK_ABORT if (pthread_mutex_lock(&m->mutex) == 0) { - __sync_fetch_and_add(&m->sleep, 1); + ++ m->sleep; // "spurious wakeup" is harmless, // because skynet_context_message_dispatch() can be call at any time. pthread_cond_wait(&m->cond, &m->mutex); - __sync_fetch_and_sub(&m->sleep, 1); + -- m->sleep; if (pthread_mutex_unlock(&m->mutex)) { fprintf(stderr, "unlock mutex error"); exit(1);