Attempt to make the main thread wait for network mutex.

This commit is contained in:
OBattler
2022-02-20 01:22:28 +01:00
parent ee5630f9c4
commit bd32abf94e
3 changed files with 12 additions and 1 deletions

View File

@@ -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)
{