NzMutex is now a recursive mutex

Former-commit-id: c36c5543dfb8f79a6b961ef6c97aa9f647c93e57
This commit is contained in:
Youri Hubaut 2015-05-03 16:15:48 +02:00
parent 4bbb02eadc
commit 7b2e6bb3f2
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,11 @@
NzMutexImpl::NzMutexImpl() NzMutexImpl::NzMutexImpl()
{ {
pthread_mutex_init(&m_handle, nullptr); pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m_handle, &attr);
} }
NzMutexImpl::~NzMutexImpl() NzMutexImpl::~NzMutexImpl()