[resend] pthreads: Allow compilation again on older platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new NPTL & pthread emulation stuff makes Wine no longer compile on
platforms (e.g. NetBSD) which worked fine previously, where clone() was used
in a raw-threading model.

(I'd like some clarification on whether Wine will continue to support raw
clone() with internal libc locking for the time being, as NetBSD and some
other platforms are still missing stable pthread-kernel glue.  The following
patch at least *seems* to make Wine work again on simple apps including the
supplied clock, etc.)

This diff propagates the "#if defined()" conditions surrounding the
definitions of PTHREAD_init_{done,thread}() in scheduler/pthread.c, to the
places where these functions are called.

Index: dlls/ntdll/sysdeps.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/sysdeps.c,v
retrieving revision 1.8
diff -u -r1.8 sysdeps.c
--- dlls/ntdll/sysdeps.c	21 Aug 2003 21:34:34 -0000	1.8
+++ dlls/ntdll/sysdeps.c	26 Aug 2003 21:16:52 -0000
@@ -101,7 +101,8 @@

 #ifdef HAVE_NPTL
     teb->pthread_data = (void *)pthread_self();
-#else
+#elif defined(__GLIBC__) || defined(__FreeBSD__)
+    /* defined() above matches scheduler/pthread.c */
     PTHREAD_init_thread();
 #endif
 }
Index: scheduler/process.c
===================================================================
RCS file: /home/wine/wine/scheduler/process.c,v
retrieving revision 1.226
diff -u -r1.226 process.c
--- scheduler/process.c	19 Aug 2003 01:05:18 -0000	1.226
+++ scheduler/process.c	26 Aug 2003 21:16:52 -0000
@@ -359,8 +359,11 @@
             process_pmts.hStdError = console_handle_map(process_pmts.hStdError);
     }

+#if defined(__GLIBC__) || defined(__FreeBSD__)
+    /* defined() above matches scheduler/pthread.c */
     /* Now we can use the pthreads routines */
     PTHREAD_init_done();
+#endif

     /* Copy the parent environment */
     if (!init_user_process_pmts( info_size, main_exe_name, sizeof(main_exe_name) ))

-- 
-- Todd Vierling <tv@pobox.com>


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux