|
|
|
|||||
|
portability problems with RecMutex ctor
The RecMutex ctor has a non-std way of initialising the mutex attributes. It uses PTHREAD_MUTEX_RECURSIVE_NP instead of PTHREAD_MUTEX_RECURSIVE. This stops it compiling on Solaris. There is also a more std way to initalise the mutex attributes. The fixed code is:
IceUtil::RecMutex::RecMutex() : _count(0) { pthread_mutexattr_t attr; int rc = pthread_mutexattr_init(&attr); if(rc != 0) { throw ThreadSyscallException(__FILE__, __LINE__); } rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); if(rc != 0) { throw ThreadSyscallException(__FILE__, __LINE__); } rc = pthread_mutex_init(&_mutex, &attr); if(rc != 0) { throw ThreadSyscallException(__FILE__, __LINE__); } } Regards, Andrew M.
__________________
You are in a maze of twisty little passages, all different. |
|
|||||
|
Indeed you are correct!!
In fact, did you know that "_NP" in PTHREAD_MUTEX_RECURSIVE_NP stands for "Not Portable"! I'm going to try your patch on FreeBSD. Thanks!
__________________
-- Craig Rodrigues |
|
|||||
|
Quote:
-Andrew
__________________
You are in a maze of twisty little passages, all different. |
|
||||||
|
Quote:
Thanks, Marc |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Doc: return value of RecMutex::tryLock() | n2503v | Comments | 1 | 12-18-2006 03:45 AM |
| Reliability, Footprint & Portability | prakashbuddhira | Help Center | 1 | 04-03-2006 05:36 AM |
| some problems with dll | simpley | Help Center | 1 | 01-21-2005 03:18 AM |
| Hello example problems | jpm | Help Center | 1 | 06-02-2003 03:26 PM |
| Portability problems with iceccp | marlowa | Bug Reports | 0 | 02-21-2003 08:54 AM |