[RFC] pthread emulation on FreeBSD (and Linux)

Alexandre Julliard julliard at winehq.com
Mon Nov 25 12:09:11 CST 2002


Patrik Stridvall <ps at leissner.se> writes:

> FreeBSD since it AFAICS have no default overridable implementation
> seems to require that we have some sort of wine_pthread library to
> implement pthreads from scratch like outlined in the attached patch.

I don't think you need a separate library, ntdll should do fine (once
scheduler/pthread.c is adapted to work on FreeBSD of course). You just
need some default implementation for the missing symbols before they
get overriden by ntdll. Does this work for you?

Index: configure.ac
===================================================================
RCS file: /opt/cvs-commit/wine/configure.ac,v
retrieving revision 1.100
diff -u -r1.100 configure.ac
--- configure.ac	23 Nov 2002 01:20:02 -0000	1.100
+++ configure.ac	25 Nov 2002 18:05:47 -0000
@@ -947,6 +947,11 @@
 	pclose \
 	popen \
 	pread \
+	pthread_getspecific \
+	pthread_key_create \
+	pthread_mutex_lock \
+	pthread_mutex_unlock \
+	pthread_setspecific \
 	pwrite \
 	rfork \
 	select \
Index: library/port.c
===================================================================
RCS file: /opt/cvs-commit/wine/library/port.c,v
retrieving revision 1.37
diff -u -r1.37 port.c
--- library/port.c	18 Oct 2002 00:27:38 -0000	1.37
+++ library/port.c	25 Nov 2002 18:05:53 -0000
@@ -680,6 +680,31 @@
 
 
 /***********************************************************************
+ *		pthread functions
+ */
+
+#ifndef HAVE_PTHREAD_KEY_CREATE
+int pthread_key_create() { return 0; }
+#endif
+
+#ifndef HAVE_PTHREAD_GETSPECIFIC
+int pthread_mutex_getspecific() { return 0; }
+#endif
+
+#ifndef HAVE_PTHREAD_SETSPECIFIC
+int pthread_mutex_setspecific() { return 0; }
+#endif
+
+#ifndef HAVE_PTHREAD_MUTEX_LOCK
+int pthread_mutex_lock() { return 0; }
+#endif
+
+#ifndef HAVE_PTHREAD_MUTEX_UNLOCK
+int pthread_mutex_unlock() { return 0; }
+#endif
+
+
+/***********************************************************************
  *		interlocked functions
  */
 #ifdef __i386__

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list