diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-08-06 12:32:56 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-08-06 12:32:56 +0300 |
commit | 72e8833beae176f61763702947dfe83f7c23c737 (patch) | |
tree | 59e5ea74cfb9d9ec19f7c379f107a9b650ebc400 /include/my_pthread.h | |
parent | 4c1712e40171e2861359878ea885e14936298acf (diff) | |
download | mariadb-git-72e8833beae176f61763702947dfe83f7c23c737.tar.gz |
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
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r-- | include/my_pthread.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index bcad292ecc9..004c908e08e 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -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 */ |