소스 검색

Fix Darwin build: Remove unused pthread_spinlock macros (which are duplicates for our own spin locks), include common_barrier.h for the pthread_barrier_t type

Samuel Thibault 12 년 전
부모
커밋
27fd79e4c2
2개의 변경된 파일3개의 추가작업 그리고 36개의 파일을 삭제
  1. 1 34
      src/common/utils.h
  2. 2 2
      src/datawizard/coherency.c

+ 1 - 34
src/common/utils.h

@@ -25,6 +25,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include <math.h>
+#include <common/barrier.h>
 
 #ifdef STARPU_SIMGRID
 #include <xbt/synchro_core.h>
@@ -441,38 +442,4 @@ typedef pthread_barrier_t _starpu_pthread_barrier_t;
 	}                                                                      \
 } while (0)
 
-typedef pthread_spinlock_t _starpu_pthread_spinlock_t;
-/*
- * Encapsulation of the pthread_spin_* functions.
- */
-#define _STARPU_PTHREAD_SPIN_DESTROY(lock) do {                                \
-	int p_ret = pthread_spin_destroy(lock);                                \
-	if (STARPU_UNLIKELY(p_ret)) {                                          \
-		fprintf(stderr,                                                \
-			"%s:%d pthread_spin_destroy: %s\n",                    \
-			__FILE__, __LINE__, strerror(p_ret));                  \
-		STARPU_ABORT();                                                \
-	}                                                                      \
-} while (0)
-
-#define _STARPU_PTHREAD_SPIN_LOCK(lock) do {                                   \
-	int p_ret = pthread_spin_lock(lock);                                   \
-	if (STARPU_UNLIKELY(p_ret)) {                                          \
-		fprintf(stderr,                                                \
-			"%s:%d pthread_spin_lock: %s\n",                       \
-			__FILE__, __LINE__, strerror(p_ret));                  \
-		STARPU_ABORT();                                                \
-	}                                                                      \
-} while (0)
-
-#define _STARPU_PTHREAD_SPIN_UNLOCK(lock) do {                                 \
-	int p_ret = pthread_spin_unlock(lock);                                 \
-	if (STARPU_UNLIKELY(p_ret)) {                                          \
-		fprintf(stderr,                                                \
-			"%s:%d pthread_spin_unlock: %s\n",                     \
-			__FILE__, __LINE__, strerror(p_ret));                  \
-		STARPU_ABORT();                                                \
-	}                                                                      \
-} while (0)
-
 #endif // __COMMON_UTILS_H__

+ 2 - 2
src/datawizard/coherency.c

@@ -568,7 +568,7 @@ void _starpu_release_data_on_node(starpu_data_handle_t handle, uint32_t default_
 static void _starpu_set_data_requested_flag_if_needed(struct _starpu_data_replicate *replicate)
 {
 // XXX : this is just a hint, so we don't take the lock ...
-//	_STARPU_PTHREAD_SPIN_LOCK(&handle->header_lock);
+//	_starpu_spin_lock(&handle->header_lock);
 
 	if (replicate->state == STARPU_INVALID)
 	{
@@ -576,7 +576,7 @@ static void _starpu_set_data_requested_flag_if_needed(struct _starpu_data_replic
 		replicate->requested[dst_node] = 1;
 	}
 
-//	_STARPU_PTHREAD_SPIN_UNLOCK(&handle->header_lock);
+//	_starpu_spin_unlock(&handle->header_lock);
 }
 
 int starpu_prefetch_task_input_on_node(struct starpu_task *task, uint32_t node)