xref: /haiku/src/libs/posix_error_mapper/pthread_cond.cpp (revision 691b9fac726b192b8c9da9d8905ad512f0366846)
1*39d58e2fSIngo Weinhold /*
2*39d58e2fSIngo Weinhold  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3*39d58e2fSIngo Weinhold  * Distributed under the terms of the MIT License.
4*39d58e2fSIngo Weinhold  */
5*39d58e2fSIngo Weinhold 
6*39d58e2fSIngo Weinhold #include <pthread.h>
7*39d58e2fSIngo Weinhold 
8*39d58e2fSIngo Weinhold #include "posix_error_mapper.h"
9*39d58e2fSIngo Weinhold 
10*39d58e2fSIngo Weinhold 
11*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_destroy, (pthread_cond_t *cond),
12*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_destroy(cond));
13*39d58e2fSIngo Weinhold )
14*39d58e2fSIngo Weinhold 
15*39d58e2fSIngo Weinhold 
16*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_init, (pthread_cond_t *cond,
17*39d58e2fSIngo Weinhold 		const pthread_condattr_t *attr),
18*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_init(cond, attr));
19*39d58e2fSIngo Weinhold )
20*39d58e2fSIngo Weinhold 
21*39d58e2fSIngo Weinhold 
22*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_broadcast, (pthread_cond_t *cond),
23*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_broadcast(cond));
24*39d58e2fSIngo Weinhold )
25*39d58e2fSIngo Weinhold 
26*39d58e2fSIngo Weinhold 
27*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_signal, (pthread_cond_t *cond),
28*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_signal(cond));
29*39d58e2fSIngo Weinhold )
30*39d58e2fSIngo Weinhold 
31*39d58e2fSIngo Weinhold 
32*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_timedwait, (pthread_cond_t *cond,
33*39d58e2fSIngo Weinhold 		pthread_mutex_t *mutex, const struct timespec *abstime),
34*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_timedwait(cond, mutex,
35*39d58e2fSIngo Weinhold 		abstime));
36*39d58e2fSIngo Weinhold )
37*39d58e2fSIngo Weinhold 
38*39d58e2fSIngo Weinhold 
39*39d58e2fSIngo Weinhold WRAPPER_FUNCTION(int, pthread_cond_wait, (pthread_cond_t *cond,
40*39d58e2fSIngo Weinhold 		pthread_mutex_t *mutex),
41*39d58e2fSIngo Weinhold 	return B_TO_POSITIVE_ERROR(sReal_pthread_cond_wait(cond, mutex));
42*39d58e2fSIngo Weinhold )
43*39d58e2fSIngo Weinhold 
44