Fix 2008-08-03 change.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Aug 2008 10:41:12 +0000 (12:41 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Aug 2008 10:41:12 +0000 (12:41 +0200)
ChangeLog
lib/glthread/lock.c
lib/glthread/lock.h

index d60d1e2e82999af0b090294de7a0f04db3d4c2fe..5f017b535f8afb8d8fcef7ccc83384b7a8c4855c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-18  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <bruno@clisp.org>
 
        * lib/glthread/thread.c: Avoid forcing a context switch right after
index 2ad0e06e7057ebee89e9fda9e5fcff9e7d930f0d..487d23d0543d6c9825649865892f05bb2f2548f9 100644 (file)
@@ -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
index fd749415daa3a53660581c92afafe5e3bbf7a029..391165adf891abadf1671cdc6130f8e3fb31829d 100644 (file)
@@ -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);