PATCH: scheduler/pthread.c

Gerald Pfeifer pfeifer at dbai.tuwien.ac.at
Tue Jan 28 16:34:49 CST 2003


pthread_t is a long integer on Linux "by chance"; by virtue of POSIX
it could also be a pointer type (and is just that on FreeBSD).

Tested on SuSE 8.0 and FreeBSD 4.7.

Gerald

ChangeLog:
Add missing casts related to pthread_t. Tweak comments.

Index: pthread.c
===================================================================
RCS file: /home/wine/wine/scheduler/pthread.c,v
retrieving revision 1.29
diff -u -3 -p -r1.29 pthread.c
--- pthread.c	25 Nov 2002 21:12:26 -0000	1.29
+++ pthread.c	28 Jan 2003 22:30:28 -0000
@@ -127,7 +127,8 @@ int pthread_create(pthread_t* thread, co

   idata->start_routine = start_routine;
   idata->arg = arg;
-  hThread = CreateThread(NULL, 0, pthread_thread_start, idata, 0, thread);
+  hThread = CreateThread( NULL, 0, pthread_thread_start, idata, 0,
+                          (LPDWORD)thread);

   if(hThread)
     CloseHandle(hThread);
@@ -142,7 +143,7 @@ int pthread_create(pthread_t* thread, co

 int pthread_cancel(pthread_t thread)
 {
-  HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thread);
+  HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, (DWORD)thread);

   if(!TerminateThread(hThread, 0))
   {
@@ -157,7 +158,7 @@ int pthread_cancel(pthread_t thread)

 int pthread_join(pthread_t thread, void **value_ptr)
 {
-  HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thread);
+  HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, (DWORD)thread);

   WaitForSingleObject(hThread, INFINITE);
   if(!GetExitCodeThread(hThread, (LPDWORD)value_ptr))
@@ -660,10 +661,10 @@ int sigaction(int signum, const struct s
     return libc_sigaction(signum, act, oldact);
 }

-#else /* __GLIBC__ */
+#else /* __GLIBC__ || __FREEBSD__ */

 void PTHREAD_init_done(void)
 {
 }

-#endif /* __GLIBC__ */
+#endif /* __GLIBC__ || __FREEBSD__ */



More information about the wine-patches mailing list