X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fthreads.c;h=0cc958f6b93dcc63a0154480d0b9af30e5688545;hb=c18ab57cb2da67f47b74a00cdc3bff6c80c803cb;hp=f0c701403eae4de819cd1aa96718cce3ea567fd0;hpb=30680da0fe1192be08f2ff02d912e3b8a0f1212f;p=libucw.git diff --git a/ucw/threads.c b/ucw/threads.c index f0c70140..0cc958f6 100644 --- a/ucw/threads.c +++ b/ucw/threads.c @@ -67,6 +67,12 @@ ucwlib_tid(void) /*** Thread context ***/ +static void CONSTRUCTOR +ucwlib_threads_init_master(void) +{ + pthread_mutex_init(&ucwlib_master_mutex, NULL); +} + #ifdef CONFIG_UCW_TLS __thread struct ucwlib_context ucwlib_context; @@ -94,7 +100,6 @@ ucwlib_threads_init(void) { if (pthread_key_create(&ucwlib_context_key, ucwlib_free_thread_context) < 0) die("Cannot create pthread_key: %m"); - pthread_mutex_init(&ucwlib_master_mutex, NULL); } struct ucwlib_context *