From: Bruno Haible Date: Mon, 18 Aug 2008 10:41:12 +0000 (+0200) Subject: Fix 2008-08-03 change. X-Git-Tag: v0.1~7135^2~10 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=cf4af8a2054f7e730f3247671d693f605e68b4a3;p=gnulib.git Fix 2008-08-03 change. --- diff --git a/ChangeLog b/ChangeLog index d60d1e2e8..5f017b535 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2008-08-18 Bruno Haible + * lib/glthread/lock.h [USE_SOLARIS_THREADS]: Fix + glthread_recursive_lock_* macros. + * lib/glthread/lock.c (glthread_recursive_lock_destroy_multithreaded): + Fix syntax error. + +2008-08-18 Bruno Haible + * lib/glthread/thread.c: Avoid forcing a context switch right after thread creation. diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c index 2ad0e06e7..487d23d05 100644 --- a/lib/glthread/lock.c +++ b/lib/glthread/lock.c @@ -445,7 +445,7 @@ glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { if (lock->owner != (pthread_t) 0) return EBUSY; - return (pthread_mutex_destroy (&lock->mutex); + return pthread_mutex_destroy (&lock->mutex); } # endif diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index fd749415d..391165adf 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -577,33 +577,13 @@ typedef struct # define gl_recursive_lock_initializer \ { DEFAULTMUTEX, (thread_t) 0, 0 } # define glthread_recursive_lock_init(LOCK) \ - do \ - { \ - if (thread_in_use ()) \ - glthread_recursive_lock_init_multithreaded (LOCK); \ - } \ - while (0) + (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0) # define glthread_recursive_lock_lock(LOCK) \ - do \ - { \ - if (thread_in_use ()) \ - glthread_recursive_lock_lock_multithreaded (LOCK); \ - } \ - while (0) + (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0) # define glthread_recursive_lock_unlock(LOCK) \ - do \ - { \ - if (thread_in_use ()) \ - glthread_recursive_lock_unlock_multithreaded (LOCK); \ - } \ - while (0) + (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0) # define glthread_recursive_lock_destroy(LOCK) \ - do \ - { \ - if (thread_in_use ()) \ - glthread_recursive_lock_destroy_multithreaded (LOCK); \ - } \ - while (0) + (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0) extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock); extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock); extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);