Browse Source

thread: encapsulate pthread_exit function

Nathalie Furmento 11 years ago
parent
commit
2666e2d046
2 changed files with 9 additions and 0 deletions
  1. 2 0
      include/starpu_thread.h
  2. 7 0
      src/common/thread.c

+ 2 - 0
include/starpu_thread.h

@@ -43,6 +43,7 @@ typedef int starpu_pthread_attr_t;
 int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg, int where);
 int starpu_pthread_create(starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
 int starpu_pthread_join(starpu_pthread_t thread, void **retval);
+int starpu_pthread_exit(void *retval);
 int starpu_pthread_attr_init(starpu_pthread_attr_t *attr);
 int starpu_pthread_attr_destroy(starpu_pthread_attr_t *attr);
 int starpu_pthread_attr_setdetachstate(starpu_pthread_attr_t *attr, int detachstate);
@@ -55,6 +56,7 @@ typedef pthread_attr_t starpu_pthread_attr_t;
 #define starpu_pthread_create pthread_create
 #define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(thread, attr, routine, arg)
 #define starpu_pthread_join pthread_join
+#define starpu_pthread_exit pthread_exit
 #define starpu_pthread_attr_init pthread_attr_init
 #define starpu_pthread_attr_destroy pthread_attr_destroy
 #define starpu_pthread_attr_setdetachstate pthread_attr_setdetachstate

+ 7 - 0
src/common/thread.c

@@ -54,6 +54,13 @@ int starpu_pthread_join(starpu_pthread_t thread, void **retval)
 	return 0;
 }
 
+int starpu_pthread_exit(void *retval)
+{
+	MSG_process_kill(MSG_process_self());
+	return 0;
+}
+
+
 int starpu_pthread_attr_init(starpu_pthread_attr_t *attr)
 {
 	return 0;