added qse_mtx_trylock() and QSE::Mutex::trylock()

This commit is contained in:
2018-08-16 03:45:17 +00:00
parent 0aca321aee
commit 73567527f1
8 changed files with 99 additions and 9 deletions

View File

@ -38,7 +38,17 @@ public:
while (1)
{
#if 0
rqdata->mtx.lock ();
#else
while (!rqdata->mtx.trylock())
{
qse_mtx_lock (g_prmtx, QSE_NULL);
qse_printf (QSE_T("[%p] -> retrying to lock\n"), this, i);
qse_mtx_unlock (g_prmtx);
}
#endif
if (rqdata->stop)
{
rqdata->mtx.unlock ();