@@ -21,75 +21,73 @@ #import "mutex.h" #include -bool +int of_mutex_new(of_mutex_t *mutex) { InitSemaphore(mutex); - return true; + return 0; } -bool +int of_mutex_lock(of_mutex_t *mutex) { ObtainSemaphore(mutex); - return true; + return 0; } -bool +int of_mutex_trylock(of_mutex_t *mutex) { - if (!AttemptSemaphore(mutex)) { - errno = EBUSY; - return false; - } + if (!AttemptSemaphore(mutex)) + return EBUSY; - return true; + return 0; } -bool +int of_mutex_unlock(of_mutex_t *mutex) { ReleaseSemaphore(mutex); - return true; + return 0; } -bool +int of_mutex_free(of_mutex_t *mutex) { - return true; + return 0; } -bool +int of_rmutex_new(of_rmutex_t *rmutex) { return of_mutex_new(rmutex); } -bool +int of_rmutex_lock(of_rmutex_t *rmutex) { return of_mutex_lock(rmutex); } -bool +int of_rmutex_trylock(of_rmutex_t *rmutex) { return of_mutex_trylock(rmutex); } -bool +int of_rmutex_unlock(of_rmutex_t *rmutex) { return of_mutex_unlock(rmutex); } -bool +int of_rmutex_free(of_rmutex_t *rmutex) { return of_mutex_free(rmutex); }