From: Bruno Haible Date: Mon, 18 Aug 2008 10:43:05 +0000 (+0000) Subject: Fix 2008-08-03 commit. X-Git-Tag: v0.18~366 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e0edee57dde5294a1d80a82f22d45b70a067d53;p=thirdparty%2Fgettext.git Fix 2008-08-03 commit. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 0395842ef..d7dc75b34 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,9 @@ +2008-08-18 Bruno Haible + + * lock.h [USE_SOLARIS_THREADS]: Fix glthread_recursive_lock_* macros. + * lock.c (glthread_recursive_lock_destroy_multithreaded): Fix syntax + error. + 2008-08-17 Bruno Haible * lock.h: Include always. diff --git a/gettext-runtime/intl/lock.c b/gettext-runtime/intl/lock.c index 31c05bc05..5a6212514 100644 --- a/gettext-runtime/intl/lock.c +++ b/gettext-runtime/intl/lock.c @@ -446,7 +446,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/gettext-runtime/intl/lock.h b/gettext-runtime/intl/lock.h index 7b0d26dc3..c7afa66b1 100644 --- a/gettext-runtime/intl/lock.h +++ b/gettext-runtime/intl/lock.h @@ -578,33 +578,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);