diff options
author | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-04 04:44:16 +0000 |
---|---|---|
committer | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-04 04:44:16 +0000 |
commit | 968eccd1d1cb7a43a7f05050d7b645da79966e6d (patch) | |
tree | c25ed40d99951a378924d7b8216afe20756f95ed /include/sys/thread.h | |
parent | 996faa68697ec79f37e44999b901f07d6c8f94a2 (diff) |
Update the thread shim to use the current kernel threading API.
We need to use kthread_create() here for a few reasons. First
off to old kernel_thread() API functioin will be going away.
Secondly, and more importantly if I use kthread_create() we can
then properly implement a thread_exit() function which terminates
the kernel thread at any point with do_exit(). This fixes our
cleanup bug which was caused by dropping a mutex twice after
thread_exit() didn't really exit.
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@66 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys/thread.h')
-rw-r--r-- | include/sys/thread.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/sys/thread.h b/include/sys/thread.h index c7b104374..8424070e2 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -8,6 +8,7 @@ extern "C" { #include <linux/module.h> #include <linux/mm.h> #include <linux/spinlock.h> +#include <linux/kthread.h> #include <sys/types.h> #include <sys/sysmacros.h> @@ -30,14 +31,14 @@ typedef void (*thread_func_t)(void *); #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ __thread_create(stk, stksize, (thread_func_t)func, \ - arg, len, pp, state, pri) + #func, arg, len, pp, state, pri) #define thread_exit() __thread_exit() #define curthread get_current() extern kthread_t *__thread_create(caddr_t stk, size_t stksize, - thread_func_t func, void *args, - size_t len, int *pp, int state, - pri_t pri); + thread_func_t func, const char *name, + void *args, size_t len, int *pp, + int state, pri_t pri); extern void __thread_exit(void); #ifdef __cplusplus |