early return is mutex is null

This commit is contained in:
Brad Parker 2017-01-05 21:20:37 -05:00
parent 35a9a74982
commit 9d7fe2c3f0

View File

@ -277,6 +277,8 @@ void slock_free(slock_t *lock)
**/
void slock_lock(slock_t *lock)
{
if (!lock)
return;
#ifdef USE_WIN32_THREADS
WaitForSingleObject(lock->lock, INFINITE);
#else
@ -292,6 +294,8 @@ void slock_lock(slock_t *lock)
**/
void slock_unlock(slock_t *lock)
{
if (!lock)
return;
#ifdef USE_WIN32_THREADS
ReleaseMutex(lock->lock);
#else