[haiku-commits] r36334 - haiku/trunk/src/libs/posix_error_mapper

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 17 Apr 2010 21:59:02 +0200 (CEST)

Author: bonefish
Date: 2010-04-17 21:59:02 +0200 (Sat, 17 Apr 2010)
New Revision: 36334
Changeset: http://dev.haiku-os.org/changeset/36334/haiku

Added:
   haiku/trunk/src/libs/posix_error_mapper/pthread_spinlock.cpp
Modified:
   haiku/trunk/src/libs/posix_error_mapper/Jamfile
Log:
Added wrappers for the spinlock functions.


Modified: haiku/trunk/src/libs/posix_error_mapper/Jamfile
===================================================================
--- haiku/trunk/src/libs/posix_error_mapper/Jamfile     2010-04-17 19:38:01 UTC 
(rev 36333)
+++ haiku/trunk/src/libs/posix_error_mapper/Jamfile     2010-04-17 19:59:02 UTC 
(rev 36334)
@@ -11,6 +11,7 @@
        pthread_rwlockattr.cpp
        pthread_rwlock.cpp
        pthread_specific.cpp
+       pthread_spinlock.cpp
        pthread_thread.cpp
        signal.cpp
 ;

Added: haiku/trunk/src/libs/posix_error_mapper/pthread_spinlock.cpp
===================================================================
--- haiku/trunk/src/libs/posix_error_mapper/pthread_spinlock.cpp                
                (rev 0)
+++ haiku/trunk/src/libs/posix_error_mapper/pthread_spinlock.cpp        
2010-04-17 19:59:02 UTC (rev 36334)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010, Ingo Weinhold, ingo_weinhold@xxxxxxx
+ * 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));
+)


Other related posts:

  • » [haiku-commits] r36334 - haiku/trunk/src/libs/posix_error_mapper - ingo_weinhold