aboutsummaryrefslogtreecommitdiff
path: root/src/common/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/helper.c')
-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 */