diff options
Diffstat (limited to 'src/common/helper.c')
-rw-r--r-- | src/common/helper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/helper.c b/src/common/helper.c index 39594109..d1a91de9 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -476,8 +476,7 @@ void run_with_save_calls(PThreadMain cb, | |||
476 | &cls, | 476 | &cls, |
477 | 64*1024)) | 477 | 64*1024)) |
478 | DIE_STRERROR("pthread_create"); | 478 | DIE_STRERROR("pthread_create"); |
479 | if ( (! PTHREAD_SELF_TEST(&mainThread)) || | 479 | if (! PTHREAD_SELF_TEST(&mainThread)) { |
480 | (pscCount == 0) ) { | ||
481 | /* another thread will run the save calls */ | 480 | /* another thread will run the save calls */ |
482 | SEMAPHORE_DOWN(cls.sig); | 481 | SEMAPHORE_DOWN(cls.sig); |
483 | } else { | 482 | } else { |
@@ -489,7 +488,8 @@ void run_with_save_calls(PThreadMain cb, | |||
489 | saveCallWrapper(psc[i]); | 488 | saveCallWrapper(psc[i]); |
490 | } | 489 | } |
491 | MUTEX_UNLOCK(&sclock); | 490 | MUTEX_UNLOCK(&sclock); |
492 | gnunet_util_sleep(50 * cronMILLIS); | 491 | if (OK != SEMAPHORE_DOWN_NONBLOCKING(cls.sig)) |
492 | gnunet_util_sleep(50 * cronMILLIS); | ||
493 | } | 493 | } |
494 | } | 494 | } |
495 | PTHREAD_JOIN(&doneThread, | 495 | PTHREAD_JOIN(&doneThread, |