medfall

A super great game engine
Log | Files | Refs

commit 5772d6e733225cdbed8168e0e4f9ce7eaa44c9e4
parent 679bda82585987b739868a5fefdd64c662f4379f
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat, 26 May 2018 18:36:45 +0300

Remove mutex_trylock

Diffstat:
unix_mutex.h | 8--------
win32_mutex.h | 4----
2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/unix_mutex.h b/unix_mutex.h @@ -28,14 +28,6 @@ inline void mutex_lock( Mutex * mutex ) { } } -inline bool mutex_trylock( Mutex * mutex ) { - int ok = pthread_mutex_trylock( &mutex->mutex ); - if( ok == 0 ) return true; - if( ok == EBUSY ) return false; - - err( 1, "pthread_mutex_lock: %d", ok ); -} - inline void mutex_unlock( Mutex * mutex ) { int ok = pthread_mutex_unlock( &mutex->mutex ); if( ok != 0 ) { diff --git a/win32_mutex.h b/win32_mutex.h @@ -20,10 +20,6 @@ inline void mutex_lock( Mutex * mutex ) { EnterCriticalSection( &mutex->cs ); } -inline bool mutex_trylock( Mutex * mutex ) { - return TryEnterCriticalSection( &mutex->cs ) != 0; -} - inline void mutex_unlock( Mutex * mutex ) { LeaveCriticalSection( &mutex->cs ); }