Fixed pthreads on FreeBSD (based on patch by Alexandre Julliard).

This commit is contained in:
Patrik Stridvall 2002-11-25 21:12:26 +00:00 committed by Alexandre Julliard
parent 1b20db4f19
commit 6caeb721e3
5 changed files with 62 additions and 3 deletions

10
configure vendored
View file

@ -11543,6 +11543,11 @@ fi
@ -11580,6 +11585,11 @@ for ac_func in \
pclose \ pclose \
popen \ popen \
pread \ pread \
pthread_getspecific \
pthread_key_create \
pthread_mutex_lock \
pthread_mutex_unlock \
pthread_setspecific \
pwrite \ pwrite \
rfork \ rfork \
select \ select \

View file

@ -947,6 +947,11 @@ AC_CHECK_FUNCS(\
pclose \ pclose \
popen \ popen \
pread \ pread \
pthread_getspecific \
pthread_key_create \
pthread_mutex_lock \
pthread_mutex_unlock \
pthread_setspecific \
pwrite \ pwrite \
rfork \ rfork \
select \ select \

View file

@ -368,6 +368,21 @@
/* Define to 1 if you have the `pread' function. */ /* Define to 1 if you have the `pread' function. */
#undef HAVE_PREAD #undef HAVE_PREAD
/* Define to 1 if you have the `pthread_getspecific' function. */
#undef HAVE_PTHREAD_GETSPECIFIC
/* Define to 1 if you have the `pthread_key_create' function. */
#undef HAVE_PTHREAD_KEY_CREATE
/* Define to 1 if you have the `pthread_mutex_lock' function. */
#undef HAVE_PTHREAD_MUTEX_LOCK
/* Define to 1 if you have the `pthread_mutex_unlock' function. */
#undef HAVE_PTHREAD_MUTEX_UNLOCK
/* Define to 1 if you have the `pthread_setspecific' function. */
#undef HAVE_PTHREAD_SETSPECIFIC
/* Define to 1 if you have the <pty.h> header file. */ /* Define to 1 if you have the <pty.h> header file. */
#undef HAVE_PTY_H #undef HAVE_PTY_H

View file

@ -679,6 +679,30 @@ void *wine_memcpy_unaligned( void *dst, const void *src, size_t size )
#endif #endif
/***********************************************************************
* pthread functions
*/
#ifndef HAVE_PTHREAD_GETSPECIFIC
void pthread_getspecific() { assert(0); }
#endif
#ifndef HAVE_PTHREAD_KEY_CREATE
void pthread_key_create() { assert(0); }
#endif
#ifndef HAVE_PTHREAD_MUTEX_LOCK
void pthread_mutex_lock() { assert(0); }
#endif
#ifndef HAVE_PTHREAD_MUTEX_UNLOCK
void pthread_mutex_unlock() { assert(0); }
#endif
#ifndef HAVE_PTHREAD_SETSPECIFIC
void pthread_setspecific() { assert(0); }
#endif
/*********************************************************************** /***********************************************************************
* interlocked functions * interlocked functions
*/ */

View file

@ -44,7 +44,12 @@
* If they are not available, the libc defaults to * If they are not available, the libc defaults to
* non-threadsafe operation (not good). */ * non-threadsafe operation (not good). */
#if defined(__GLIBC__) #if defined(__GLIBC__) || defined(__FreeBSD__)
#ifndef __USE_UNIX98
#define __USE_UNIX98
#endif
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
@ -368,7 +373,7 @@ strong_alias(__pthread_mutexattr_setkind_np, pthread_mutexattr_setkind_np);
int __pthread_mutexattr_getkind_np(pthread_mutexattr_t *attr, int *kind) int __pthread_mutexattr_getkind_np(pthread_mutexattr_t *attr, int *kind)
{ {
*kind = PTHREAD_MUTEX_RECURSIVE_NP; *kind = PTHREAD_MUTEX_RECURSIVE;
return 0; return 0;
} }
strong_alias(__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np); strong_alias(__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np);
@ -381,7 +386,7 @@ strong_alias(__pthread_mutexattr_settype, pthread_mutexattr_settype);
int __pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *kind) int __pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *kind)
{ {
*kind = PTHREAD_MUTEX_RECURSIVE_NP; *kind = PTHREAD_MUTEX_RECURSIVE;
return 0; return 0;
} }
strong_alias(__pthread_mutexattr_gettype, pthread_mutexattr_gettype); strong_alias(__pthread_mutexattr_gettype, pthread_mutexattr_gettype);