Attempt to make the main thread wait for network mutex.
This commit is contained in:
@@ -37,6 +37,16 @@ thread_create_mutex(void)
|
||||
return mutex;
|
||||
}
|
||||
|
||||
int
|
||||
thread_test_mutex(mutex_t *_mutex)
|
||||
{
|
||||
if (_mutex == nullptr)
|
||||
return 0;
|
||||
|
||||
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||
return mutex->try_lock() ? 1 : 0;
|
||||
}
|
||||
|
||||
int
|
||||
thread_wait_mutex(mutex_t *_mutex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user