Revert "Use recursive mutexes in the C++ thread implementation"
This reverts commit 153ac6df9a
.
This commit is contained in:
@@ -42,7 +42,7 @@ thread_wait(thread_t *arg, int timeout)
|
||||
mutex_t *
|
||||
thread_create_mutex(void)
|
||||
{
|
||||
auto mutex = new std::recursive_mutex;
|
||||
auto mutex = new std::mutex;
|
||||
return mutex;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ thread_wait_mutex(mutex_t *_mutex)
|
||||
{
|
||||
if (_mutex == nullptr)
|
||||
return(0);
|
||||
auto mutex = reinterpret_cast<std::recursive_mutex*>(_mutex);
|
||||
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||
mutex->lock();
|
||||
return 1;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ thread_release_mutex(mutex_t *_mutex)
|
||||
{
|
||||
if (_mutex == nullptr)
|
||||
return(0);
|
||||
auto mutex = reinterpret_cast<std::recursive_mutex*>(_mutex);
|
||||
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||
mutex->unlock();
|
||||
return 1;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ thread_release_mutex(mutex_t *_mutex)
|
||||
void
|
||||
thread_close_mutex(mutex_t *_mutex)
|
||||
{
|
||||
auto mutex = reinterpret_cast<std::recursive_mutex*>(_mutex);
|
||||
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user