aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2005-08-22 03:41:43 +0000
committerChristian Grothoff <christian@grothoff.org>2005-08-22 03:41:43 +0000
commit03c50ba2ca823c47305e8837e5f2743720ee828b (patch)
tree0ea2da3709f4e20277ddc058339636d436be8a66
parentdd580a77d5e8f30cb6047390950a22d2dd6b4c2f (diff)
downloadgnunet-gtk-03c50ba2ca823c47305e8837e5f2743720ee828b.tar.gz
gnunet-gtk-03c50ba2ca823c47305e8837e5f2743720ee828b.zip
fix
-rw-r--r--src/common/helper.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/common/helper.c b/src/common/helper.c
index ebe9fd41..8c30c777 100644
--- a/src/common/helper.c
+++ b/src/common/helper.c
@@ -464,21 +464,23 @@ static void * shutdownCode(void * arg) {
464 464
465void run_with_save_calls(PThreadMain cb, 465void run_with_save_calls(PThreadMain cb,
466 void * arg) { 466 void * arg) {
467 PTHREAD_T doneThread; 467 PTHREAD_T doneThread;
468 Semaphore * sig; 468 void * unused;
469 void * unused; 469 struct rwsc_closure cls;
470 470
471 sig = SEMAPHORE_NEW(0); 471 cls.sig = SEMAPHORE_NEW(0);
472 cls.realMain = cb;
473 cls.arg = arg;
472 if (0 != PTHREAD_CREATE(&doneThread, 474 if (0 != PTHREAD_CREATE(&doneThread,
473 &shutdownCode, 475 &shutdownCode,
474 sig, 476 &cls,
475 64*1024)) 477 64*1024))
476 DIE_STRERROR("pthread_create"); 478 DIE_STRERROR("pthread_create");
477 while (OK != SEMAPHORE_DOWN_NONBLOCKING(sig)) 479 while (OK != SEMAPHORE_DOWN_NONBLOCKING(cls.sig))
478 gtkRunSomeSaveCalls(); 480 gtkRunSomeSaveCalls();
479 PTHREAD_JOIN(&doneThread, 481 PTHREAD_JOIN(&doneThread,
480 &unused); 482 &unused);
481 SEMAPHORE_FREE(sig); 483 SEMAPHORE_FREE(cls.sig);
482} 484}
483 485
484/* end of helper.c */ 486/* end of helper.c */