-inline SGMutex::SGMutex()
-{
- pthread_mutexattr_t mutex_attr;
- pthread_mutexattr_init(&mutex_attr);
- pthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED);
- int status = pthread_mutex_init( &mutex, &mutex_attr );
- assert( status == 0 );
- pthread_mutexattr_destroy(&mutex_attr);
-}
-
-inline SGMutex::~SGMutex()
-{
- int status = pthread_mutex_destroy( &mutex );
- assert( status == 0 );
-}
-
-inline void SGMutex::lock()
-{
- int status = pthread_mutex_lock( &mutex );
- assert( status == 0 );
-}
-
-inline void SGMutex::unlock()
-{
- int status = pthread_mutex_unlock( &mutex );
- assert( status == 0 );
-}
-