X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/6dbd69eeb947673bbcb552f83f439cf8516b19f6..6234a9dc385e5a9258a84227b2eab09bbb099c27:/lincan/src/kthread.c diff --git a/lincan/src/kthread.c b/lincan/src/kthread.c index d2531b9..e8e94c4 100644 --- a/lincan/src/kthread.c +++ b/lincan/src/kthread.c @@ -1,5 +1,7 @@ -#include #include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)) +#include +#endif #if defined(MODVERSIONS) #include @@ -10,7 +12,9 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40)) #include #else - #include + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)) + #include + #endif #endif #include @@ -47,7 +51,7 @@ void start_kthread(void (*func)(kthread_t *), kthread_t *kthread) in the down operation below until the thread has reached the up() operation. */ - init_MUTEX_LOCKED(&kthread->startstop_sem); + sema_init(&kthread->startstop_sem, 0); /* store the function to be executed in the data passed to the launcher */ @@ -96,7 +100,7 @@ void stop_kthread(kthread_t *kthread) will unlock it. As soon as we see the semaphore unlocked, we know that the thread has exited. */ - init_MUTEX_LOCKED(&kthread->startstop_sem); + sema_init(&kthread->startstop_sem,0); /* We need to do a memory barrier here to be sure that the flags are visible on all CPUs.