Revert "Use recursive mutexes in the C++ thread implementation"

This reverts commit 153ac6df9a.
This commit is contained in:
David Hrdlička
2021-12-17 18:51:16 +01:00
parent 9c7a3477aa
commit 0131550432

View File

@@ -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;
}