1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #include <pthread.h> 7 8 #include "posix_error_mapper.h" 9 10 11 WRAPPER_FUNCTION(int, pthread_mutex_destroy, (pthread_mutex_t *mutex), 12 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_destroy(mutex)); 13 ) 14 15 16 WRAPPER_FUNCTION(int, pthread_mutex_getprioceiling, 17 (const pthread_mutex_t *mutex, int *_priorityCeiling), 18 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_getprioceiling(mutex, 19 _priorityCeiling)); 20 ) 21 22 23 WRAPPER_FUNCTION(int, pthread_mutex_init, 24 (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr), 25 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_init(mutex, attr)); 26 ) 27 28 29 WRAPPER_FUNCTION(int, pthread_mutex_lock, (pthread_mutex_t *mutex), 30 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_lock(mutex)); 31 ) 32 33 34 WRAPPER_FUNCTION(int, pthread_mutex_setprioceiling, 35 (pthread_mutex_t *mutex, int newPriorityCeiling, 36 int *_oldPriorityCeiling), 37 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_setprioceiling(mutex, 38 newPriorityCeiling, _oldPriorityCeiling)); 39 ) 40 41 42 WRAPPER_FUNCTION(int, pthread_mutex_timedlock, 43 (pthread_mutex_t *mutex, const struct timespec *spec), 44 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_timedlock(mutex, spec)); 45 ) 46 47 48 WRAPPER_FUNCTION(int, pthread_mutex_trylock, (pthread_mutex_t *mutex), 49 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_trylock(mutex)); 50 ) 51 52 53 WRAPPER_FUNCTION(int, pthread_mutex_unlock, (pthread_mutex_t *mutex), 54 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_unlock(mutex)); 55 ) 56