diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-01 11:43:27 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-01 11:43:27 +0100 |
commit | f2cf668e6f959b5dc266c3eb7956b9d7c74c10ab (patch) | |
tree | 3c43cbb58cdcba807deff9a148509663b23962d1 /src/worker.c | |
parent | 39572126c20624c50ec8b0c0f2b08995ac435f51 (diff) | |
download | biruda-f2cf668e6f959b5dc266c3eb7956b9d7c74c10ab.tar.gz biruda-f2cf668e6f959b5dc266c3eb7956b9d7c74c10ab.tar.bz2 |
changed worker thread into a detached thread, there is no place in
the coordinator where we could join it
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/worker.c b/src/worker.c index 0ef9106..1d81205 100644 --- a/src/worker.c +++ b/src/worker.c @@ -95,9 +95,9 @@ static void *worker_func( void *thread_data ) worker->state = WORKER_STATE_RUNNING; - printf( "worker %s: entering glib worker main loop..", worker->name ); + printf( "worker %s: entering glib worker main loop..\n", worker->name ); g_main_loop_run( wed->main_loop ); - printf( "worker %s: leaving glib worker main loop..", worker->name ); + printf( "worker %s: leaving glib worker main loop..\n", worker->name ); worker->state = WORKER_STATE_STOPPED; @@ -127,6 +127,8 @@ int worker_init( worker_t *worker ) if( res != 0 ) { return 1; } + + pthread_detach( wed->thread ); return 0; } @@ -147,14 +149,5 @@ void worker_terminate( worker_t *worker ) int worker_free( worker_t *worker ) { - direct_glib_execution_worker_data_t *wed = (direct_glib_execution_worker_data_t *)worker->execution_data; - void *result; - int res; - - res = pthread_join( wed->thread, &result ); - if( res != 0 ) { - return 1; - } - return 0; } |