The attach patch fixes a thread safety issue we found with ObjectPtrBase
when we ported our application to a 64 bit platform.

It will only work if you are using a version of apr with
apr_atomic_xchgptr()


Cheers



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
--- /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.host/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp	2008-03-31 23:34:09.000000000 +0100
+++ /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.app/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp	2009-01-07 15:39:03.000000000 +0000
@@ -36,12 +36,7 @@
 void* ObjectPtrBase::exchange(void** destination, void* newValue) {
 #if _WIN32 && (!defined(_MSC_VER) || _MSC_VER >= 1300)
     return InterlockedExchangePointer(destination, newValue);
-#elif APR_SIZEOF_VOIDP == 4
-   return (void*) apr_atomic_xchg32((volatile apr_uint32_t*) destination,
-                          (apr_uint32_t) newValue);
 #else
-   void* oldValue = *destination;
-   *destination = newValue;
-   return oldValue;
+   apr_atomic_xchgptr((volatile void**)destination, newValue);
 #endif
 }

Reply via email to