added a new check for pthread_mutex_timedlock() into configure.ac

This commit is contained in:
2017-09-09 13:07:24 +00:00
parent dc53a74542
commit 70f8765ada
4 changed files with 61 additions and 0 deletions

View File

@ -212,6 +212,9 @@ int qse_mtx_lock (qse_mtx_t* mtx, const qse_ntime_t* waiting_time)
}
#else
/* if pthread_mutex_timedlock() isn't available, don't honor the waiting time. */
#if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
if (waiting_time)
{
qse_ntime_t t;
@ -226,8 +229,12 @@ int qse_mtx_lock (qse_mtx_t* mtx, const qse_ntime_t* waiting_time)
}
else
{
#endif
if (pthread_mutex_lock ((pthread_mutex_t*)&mtx->hnd) != 0) return -1;
#if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
}
#endif
#endif
return 0;