You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2007/05/12 14:58:06 UTC

svn commit: r537406 - /apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h

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)