Ver código fonte

thread: implement starpu_pthread_equal

Nathalie Furmento 8 anos atrás
pai
commit
9b83b5d21e
2 arquivos alterados com 7 adições e 0 exclusões
  1. 2 0
      include/starpu_thread.h
  2. 5 0
      src/common/thread.c

+ 2 - 0
include/starpu_thread.h

@@ -50,6 +50,7 @@ extern "C"
 typedef msg_process_t starpu_pthread_t;
 typedef int starpu_pthread_attr_t;
 
+int starpu_pthread_equal(starpu_pthread_t t1, starpu_pthread_t t2);
 starpu_pthread_t starpu_pthread_self(void);
 int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg, msg_host_t host);
 #define starpu_pthread_setname(name)
@@ -65,6 +66,7 @@ int starpu_pthread_attr_setdetachstate(starpu_pthread_attr_t *attr, int detachst
 typedef pthread_t starpu_pthread_t;
 typedef pthread_attr_t starpu_pthread_attr_t;
 
+#define starpu_pthread_equal pthread_equal
 #define starpu_pthread_self pthread_self
 #define starpu_pthread_create pthread_create
 #define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(thread, attr, routine, arg)

+ 5 - 0
src/common/thread.c

@@ -50,6 +50,11 @@ static int _starpu_futex_wake = FUTEX_WAKE;
 
 extern int _starpu_simgrid_thread_start(int argc, char *argv[]);
 
+int starpu_pthread_equal(starpu_pthread_t t1, starpu_pthread_t t2)
+{
+	return t1 == t2;
+}
+
 starpu_pthread_t starpu_pthread_self(void)
 {
 	return MSG_process_self();