From: Alexander P. <ale...@us...> - 2009-04-29 08:33:57
|
Build Version : T2.5.0.23679 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.23843 2009/04/29 08:33:52 alexpeshkof ) Update of /cvsroot/firebird/firebird2/src/jrd In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27296/src/jrd Modified Files: isc_sync.cpp Log Message: Solaris port - make robust mutexes work on solaris Index: isc_sync.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/isc_sync.cpp,v retrieving revision 1.189 retrieving revision 1.190 diff -b -U3 -r1.189 -r1.190 --- isc_sync.cpp 29 Apr 2009 01:52:46 -0000 1.189 +++ isc_sync.cpp 29 Apr 2009 08:33:51 -0000 1.190 @@ -2831,7 +2831,8 @@ * **************************************/ - return mutex_init(mutex->mtx_mutex, USYNC_PROCESS, NULL); + memset(mutex->mtx_mutex, 0, sizeof(mutex_t)); + return mutex_init(mutex->mtx_mutex, USYNC_PROCESS | LOCK_ROBUST, NULL); } @@ -3085,8 +3086,17 @@ #error Your system must support PTHREAD_PROCESS_SHARED to use Firebird. #endif +#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL + int protocolRc = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT); + if (protocolRc && (protocolRc != ENOTSUP)) + { + iscLogStatus("Pthread Error", + (Arg::Gds(isc_sys_request) << "pthread_mutexattr_setprotocol" << Arg::Unix(rc)).value()); + } +#endif #ifdef USE_ROBUST_MUTEX LOG_PTHREAD_ERROR(pthread_mutexattr_setrobust_np(&mattr, PTHREAD_MUTEX_ROBUST_NP)); + memset(mutex->mtx_mutex, 0, sizeof(pthread_mutex_t)); #endif int state = LOG_PTHREAD_ERROR(pthread_mutex_init(mutex->mtx_mutex, &mattr)); |