Merge branch 'storageareas' into zma_to_thread

This commit is contained in:
Isaac Connor
2018-08-11 10:08:30 -04:00
161 changed files with 22476 additions and 20807 deletions

View File

@@ -97,6 +97,15 @@ bool Mutex::locked() {
return( state == EBUSY );
}
RecursiveMutex::RecursiveMutex() {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if ( pthread_mutex_init(&mMutex, &attr) < 0 )
Error("Unable to create pthread mutex: %s", strerror(errno));
}
Condition::Condition( Mutex &mutex ) : mMutex( mutex ) {
if ( pthread_cond_init( &mCondition, NULL ) < 0 )
Fatal( "Unable to create pthread condition: %s", strerror(errno) );