[reSIProcate] RecursiveMutex for APPLE and INTEL_COMPILER
Adam Roach
adam at nostrum.com
Tue Sep 25 16:46:35 CDT 2007
Thanks for doing the research, Byron. I'd hate to break things for 10.1
when keeping them fixed is easy.
I propose the following (which I will commit shortly unless someone
objects):
Index: rutil/RecursiveMutex.cxx
===================================================================
--- rutil/RecursiveMutex.cxx (revision 7264)
+++ rutil/RecursiveMutex.cxx (working copy)
@@ -18,7 +18,10 @@
using resip::RecursiveMutex;
-#if defined( __APPLE__ ) || defined (__INTEL_COMPILER)
+// .abr. OS X 10.2 is OS_MAJOR_VER 6. Prior to this, OS X did not support
+// recursive mutexes.
+
+#if (defined( __APPLE__ ) && OS_MAJOR_VER < 6) || defined
(__INTEL_COMPILER)
// !cj! need to write apple/intel mutex stuff
namespace resip
{
Index: build/Makefile.all
===================================================================
--- build/Makefile.all (revision 7264)
+++ build/Makefile.all (working copy)
@@ -90,9 +90,19 @@
# Detect and normalize the OSTYPE
ifndef OSTYPE
-OSTYPE = $(shell uname)
+OSTYPE := $(shell uname)
+OSVER := $(shell uname -r)
endif
+OS_MAJOR_VER := $(word 1,$(subst ., ,$(OSVER)) 0 0 0 0)
+OS_MINOR_VER := $(word 2,$(subst ., ,$(OSVER)) 0 0 0 0)
+OS_POINT_VER := $(word 3,$(subst ., ,$(OSVER)) 0 0 0 0)
+OS_PATCH_VER := $(word 4,$(subst ., ,$(OSVER)) 0 0 0 0)
+DEFINES += OS_MAJOR_VER=$(OS_MAJOR_VER) \
+ OS_MINOR_VER=$(OS_MINOR_VER) \
+ OS_POINT_VER=$(OS_POINT_VER) \
+ OS_PATCH_VER=$(OS_PATCH_VER)
+
ifeq ($(OSTYPE),solaris)
OSTYPE = SunOS
endif
On 9/25/07 3:29 PM, Byron Campen wrote:
> After some digging, it appears that support for recursive mutexes
> was added to OS X in version 10.2. Is this sufficiently far in the
> past (last update released was 10.2.8 in Oct 2003) that we are
> comfortable with removing the defined(__APPLE__) check?
>
> Best regards,
> Byron Campen
>
>
>> Why is this ifdef to not compile RecursiveMutex in the code?
>>
>> #if defined( __APPLE__ ) || defined (__INTEL_COMPILER)
>> // !cj! need to write apple/intel mutex stuff
>> namespace resip
>> {
>>
>> RecursiveMutex::RecursiveMutex()
>> {
>> //assert(0);
>> }
>> ...
>>
>>
>> OSX (at least 10.4) can compile the regular implementation just
>> fine---we just removed the defined(__APPLE__) and recursive mutexes
>> work. I don't know about the __INTEL_COMPILER, but why are all the
>> assert(0)'s commented out? Seems like code that tries to use this
>> would want to know it's not really getting a mutex.
>>
>> Bruce
>> _______________________________________________
>> resiprocate-devel mailing list
>> resiprocate-devel at list.resiprocate.org
>> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
More information about the resiprocate-devel
mailing list