summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h68
1 files changed, 4 insertions, 64 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 21c85c633d6..404d5fb5258 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -200,28 +200,13 @@ extern int my_pthread_create_detached;
int sigwait(sigset_t *set, int *sig);
#endif
-#ifndef HAVE_NONPOSIX_SIGWAIT
#define my_sigwait(A,B) sigwait((A),(B))
-#else
-int my_sigwait(const sigset_t *set,int *sig);
-#endif
-
-#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
-#ifndef SAFE_MUTEX
-#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b))
-extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp,
- const pthread_mutexattr_t *attr);
-#endif /* SAFE_MUTEX */
-#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b))
-extern int my_pthread_cond_noposix_init(pthread_cond_t *mp,
- const pthread_condattr_t *attr);
-#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
#endif
-#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
+#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
@@ -247,24 +232,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#define my_sigset(A,B) signal((A),(B))
#endif
-#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
+#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE)
#define pthread_attr_setscope(A,B)
#undef HAVE_GETHOSTBYADDR_R /* No definition */
#endif
-#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX)
-extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- struct timespec *abstime);
-#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
-#endif
-
-#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
-#else
-#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
-void *my_pthread_getspecific_imp(pthread_key_t key);
-#endif
#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *clock, struct tm *res);
@@ -285,34 +258,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_key_delete(A) pthread_dummy(0)
#endif
-#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
-#define pthread_cond_destroy(A) pthread_dummy(0)
-#define pthread_mutex_destroy(A) pthread_dummy(0)
-#define pthread_attr_delete(A) pthread_dummy(0)
-#define pthread_condattr_delete(A) pthread_dummy(0)
-#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
-#define pthread_equal(A,B) ((A) == (B))
-#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
-#define pthread_attr_init(A) pthread_attr_create(A)
-#define pthread_attr_destroy(A) pthread_attr_delete(A)
-#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
-#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
-#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
-#undef pthread_detach_this_thread
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
-#endif
-
-#ifdef HAVE_DARWIN5_THREADS
-#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
-#define pthread_condattr_init(A) pthread_dummy(0)
-#define pthread_condattr_destroy(A) pthread_dummy(0)
-#undef pthread_detach_this_thread
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
-#endif
-
-#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
+#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \
pthread_keycreate(A,(B) ?\
@@ -352,7 +298,7 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
-#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
+#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
/* no pthread_yield() available */
#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
@@ -541,12 +487,6 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp);
/* READ-WRITE thread locking */
-#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
-#undef HAVE_PTHREAD_RWLOCK_RDLOCK
-#undef HAVE_RWLOCK_INIT
-#undef HAVE_RWLOCK_T
-#endif
-
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t