瀏覽代碼

More use of sg_actor_self

Samuel Thibault 5 年之前
父節點
當前提交
1c8a1d2087
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 4 0
      include/starpu_thread.h
  2. 4 0
      src/common/thread.c

+ 4 - 0
include/starpu_thread.h

@@ -58,7 +58,11 @@ extern "C"
 
 #ifdef STARPU_SIMGRID
 
+#ifdef STARPU_HAVE_SIMGRID_ACTOR_H
+typedef sg_actor_t starpu_pthread_t;
+#else
 typedef msg_process_t starpu_pthread_t;
+#endif
 typedef int starpu_pthread_attr_t;
 
 #ifdef STARPU_HAVE_SIMGRID_ACTOR_H

+ 4 - 0
src/common/thread.c

@@ -65,7 +65,11 @@ int starpu_pthread_equal(starpu_pthread_t t1, starpu_pthread_t t2)
 
 starpu_pthread_t starpu_pthread_self(void)
 {
+#ifdef HAVE_SG_ACTOR_SELF
+	return sg_actor_self();
+#else
 	return MSG_process_self();
+#endif
 }
 
 int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr STARPU_ATTRIBUTE_UNUSED, void *(*start_routine) (void *), void *arg, starpu_sg_host_t host)