Commit d79aab55 authored by unknown's avatar unknown

my_pthread.h, configure.in:

  In HP-UX-10.20, but not in HP-UX-11.0, the return value of pthread_mutex_trylock is inverted


configure.in:
  In HP-UX-10.20, but not in HP-UX-11.0, the return value of pthread_mutex_trylock is inverted
include/my_pthread.h:
  In HP-UX-10.20, but not in HP-UX-11.0, the return value of pthread_mutex_trylock is inverted
parent 6c12397b
......@@ -849,8 +849,8 @@ case $SYSTEM_TYPE in
;;
*hpux10.20*)
echo "Enabling workarounds for hpux 10.20"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DPTHREAD_MUTEX_TRYLOCK_INVERTED_RET_VAL"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DPTHREAD_MUTEX_TRYLOCK_INVERTED_RET_VAL"
if test "$with_named_thread" = "no"
then
echo "Using --with-named-thread=-lpthread"
......
......@@ -464,7 +464,14 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
#ifdef PTHREAD_MUTEX_TRYLOCK_INVERTED_RET_VAL
/* In HP-UX-10.20 and other old Posix 1003.4a Draft 4 implementations
pthread_mutex_trylock returns 1 on success, not 0 like
pthread_mutex_lock */
#define pthread_mutex_trylock(A) (1 - pthread_mutex_lock(A))
#else
#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
#endif
#define pthread_mutex_t safe_mutex_t
#endif /* SAFE_MUTEX */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment