apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r537406 - /apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h
Date Sat, 12 May 2007 12:58:06 GMT
Author: bojan
Date: Sat May 12 05:58:05 2007
New Revision: 537406

URL: http://svn.apache.org/viewvc?view=rev&rev=537406
Log:
Backport r537405 from the trunk.
Fix file_lock/unlock macros.

Modified:
    apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h

Modified: apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h?view=diff&rev=537406&r1=537405&r2=537406
==============================================================================
--- apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h (original)
+++ apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h Sat May 12 05:58:05 2007
@@ -111,11 +111,17 @@
 };
 
 #if APR_HAS_THREADS
-#define file_lock(f)   {if ((f)->thlock) apr_thread_mutex_lock((f)->thlock);}
-#define file_unlock(f) {if ((f)->thlock) apr_thread_mutex_unlock((f)->thlock);}
+#define file_lock(f)   do { \
+                           if ((f)->thlock) \
+                               apr_thread_mutex_lock((f)->thlock); \
+                       } while (0)
+#define file_unlock(f) do { \
+                           if ((f)->thlock) \
+                               apr_thread_mutex_unlock((f)->thlock); \
+                       } while (0)
 #else
-#define file_lock(f)   {} 
-#define file_unlock(f) {}
+#define file_lock(f)   do {} while (0)
+#define file_unlock(f) do {} while (0)
 #endif
 
 #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)



Mime
View raw message