Made sf::Mutex recursive on Unix, the behaviour is now consistent across platforms

This commit is contained in:
Laurent Gomila 2011-05-31 23:31:25 +02:00
parent f0ed4ba446
commit df61292f65
2 changed files with 17 additions and 5 deletions

View file

@ -35,7 +35,12 @@ namespace priv
////////////////////////////////////////////////////////////
MutexImpl::MutexImpl()
{
pthread_mutex_init(&myMutex, NULL);
// Make it recursive to follow the expected behaviour
pthread_mutexattr_t attributes;
pthread_mutexattr_init(&attributes);
pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&myMutex, &attributes);
}