summaryrefslogtreecommitdiff
blob: e9b51ed36a2d67b276c7900fba16bc10d58798a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- src/driver.c.orig	2008-01-27 05:38:50.000000000 +0100
+++ src/driver.c	2008-01-27 05:38:50.000000000 +0100
@@ -116,7 +116,10 @@
 static DECLARE_WAIT_QUEUE_HEAD(capi_wait);
 static DECLARE_WAIT_QUEUE_HEAD(dbg_wait);
 
+static DECLARE_COMPLETION(thread_sync); /* New DECLARE, <arnd.feldmueller@web.de> */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 static DECLARE_MUTEX_LOCKED(thread_sync);
+#endif
 
 #define SCHED_WAKEUP_CAPI       { atomic_set (&thread_capi_flag, 1); wake_up_interruptible (&capi_wait); }
 #define SCHED_WAKEUP            { atomic_set (&got_kicked, 1); wake_up_interruptible (&wait); }
@@ -1405,7 +1409,10 @@
 		}
 	}
 	LOG("Scheduler thread stopped.\n");
+	complete(&thread_sync); /* Complete Thread Sync here <arnd.feldmueller@web.de> */
+	#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 	up (&thread_sync);
+	#endif
 	return 0;
 } /* sched_thread */
 
@@ -1439,7 +1448,10 @@
 			SCHED_WAKEUP;
 		}
 		LOG("Thread signalled, waiting for termination...\n");
+		wait_for_completion(&thread_sync); /* Wait for complete Thread Sync <arnd.feldmueller@web.de> */
+		#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 		down (&thread_sync);
+		#endif
 		LOG("Thread[%d] terminated.\n", thread_pid);
 	}
 	thread_pid = -1;
--- src/common.h.orig	2005-07-07 00:00:00.000000000 +0200
+++ src/common.h	2008-01-27 05:38:50.000000000 +0100
@@ -44,7 +44,9 @@
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/
 typedef	long			intptr_t;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 typedef	unsigned long		uintptr_t;
+#endif
 
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/