Added wrappers for the spinlock functions.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36334 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-04-17 19:59:02 +00:00
parent ef1716f81b
commit b9d586e9d9
2 changed files with 35 additions and 0 deletions

View File

@ -11,6 +11,7 @@ StaticLibrary libposix_error_mapper.a :
pthread_rwlockattr.cpp
pthread_rwlock.cpp
pthread_specific.cpp
pthread_spinlock.cpp
pthread_thread.cpp
signal.cpp
;

View File

@ -0,0 +1,34 @@
/*
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#include <pthread.h>
#include "posix_error_mapper.h"
WRAPPER_FUNCTION(int, pthread_spin_init,
(pthread_spinlock_t* lock, int pshared),
return B_TO_POSITIVE_ERROR(sReal_pthread_spin_init(lock, pshared));
)
WRAPPER_FUNCTION(int, pthread_spin_destroy, (pthread_spinlock_t* lock),
return B_TO_POSITIVE_ERROR(sReal_pthread_spin_destroy(lock));
)
WRAPPER_FUNCTION(int, pthread_spin_lock, (pthread_spinlock_t* lock),
return B_TO_POSITIVE_ERROR(sReal_pthread_spin_lock(lock));
)
WRAPPER_FUNCTION(int, pthread_spin_trylock, (pthread_spinlock_t* lock),
return B_TO_POSITIVE_ERROR(sReal_pthread_spin_trylock(lock));
)
WRAPPER_FUNCTION(int, pthread_spin_unlock, (pthread_spinlock_t* lock),
return B_TO_POSITIVE_ERROR(sReal_pthread_spin_unlock(lock));
)