Browse Source

also inlint starpu_pthread_spin_init

Samuel Thibault 9 years ago
parent
commit
78988018ba
2 changed files with 20 additions and 5 deletions
  1. 5 5
      src/common/thread.c
  2. 15 0
      src/common/thread.h

+ 5 - 5
src/common/thread.c

@@ -705,16 +705,16 @@ void starpu_pthread_mutex_check_sched(starpu_pthread_mutex_t *mutex, char *file,
 
 #if defined(STARPU_SIMGRID) || (defined(STARPU_LINUX_SYS) && defined(STARPU_HAVE_XCHG)) || !defined(HAVE_PTHREAD_SPIN_LOCK)
 
-int starpu_pthread_spin_init(starpu_pthread_spinlock_t *lock, int pshared STARPU_ATTRIBUTE_UNUSED)
+#undef starpu_pthread_spin_init
+int starpu_pthread_spin_init(starpu_pthread_spinlock_t *lock, int pshared)
 {
-	lock->taken = 0;
-	return 0;
+	return _starpu_pthread_spin_init(lock, pshared);
 }
 
+#undef starpu_pthread_spin_destroy
 int starpu_pthread_spin_destroy(starpu_pthread_spinlock_t *lock STARPU_ATTRIBUTE_UNUSED)
 {
-	/* we don't do anything */
-	return 0;
+	return _starpu_pthread_spin_destroy(lock);
 }
 
 #undef starpu_pthread_spin_lock

+ 15 - 0
src/common/thread.h

@@ -26,6 +26,21 @@ int _starpu_pthread_spin_do_lock(starpu_pthread_spinlock_t *lock);
 #endif
 
 #if defined(STARPU_SIMGRID) || (defined(STARPU_LINUX_SYS) && defined(STARPU_HAVE_XCHG)) || !defined(STARPU_HAVE_PTHREAD_SPIN_LOCK)
+
+static inline int _starpu_pthread_spin_init(starpu_pthread_spinlock_t *lock, int pshared STARPU_ATTRIBUTE_UNUSED)
+{
+	lock->taken = 0;
+	return 0;
+}
+#define starpu_pthread_spin_init _starpu_pthread_spin_init
+
+static inline int _starpu_pthread_spin_destroy(starpu_pthread_spinlock_t *lock STARPU_ATTRIBUTE_UNUSED)
+{
+	/* we don't do anything */
+	return 0;
+}
+#define starpu_pthread_spin_destroy _starpu_pthread_spin_destroy
+
 static inline int _starpu_pthread_spin_lock(starpu_pthread_spinlock_t *lock)
 {
 #ifdef STARPU_SIMGRID