summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-08-17 00:35:51 +0300
committermonty@hundin.mysql.fi <>2002-08-17 00:35:51 +0300
commit5773b6504a888d61af1cdf7c0764bff7860ab90a (patch)
treea5bba2df04761e778b4e626fc71182b2708f85ff /mysys/my_pthread.c
parent5ff30464a68f70e01664a0af8dd9406e839c99ab (diff)
downloadmariadb-git-5773b6504a888d61af1cdf7c0764bff7860ab90a.tar.gz
Fixed bug in blocking handling when compiling with OPENSSL (caused hangup in client code)
Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column. Fixed bug in pthread_mutex_trylock with HPUX 11.0
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index d9487de638e..9abe5d22c92 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -17,6 +17,7 @@
/* Functions to get threads more portable */
#define DONT_REMAP_PTHREAD_FUNCTIONS
+
#include "mysys_priv.h"
#ifdef THREAD
#include <signal.h>
@@ -372,16 +373,33 @@ int pthread_signal(int sig, void (*func)())
sigaction(sig, &sact, (struct sigaction*) 0);
return 0;
}
-
#endif
+/****************************************************************************
+ The following functions fixes that all pthread functions should work
+ according to latest posix standard
+****************************************************************************/
+
+/* Undefined wrappers set my_pthread.h so that we call os functions */
+#undef pthread_mutex_init
+#undef pthread_mutex_lock
+#undef pthread_mutex_unlock
+#undef pthread_mutex_destroy
+#undef pthread_mutex_wait
+#undef pthread_mutex_timedwait
+#undef pthread_mutex_t
+#undef pthread_cond_wait
+#undef pthread_cond_timedwait
+#undef pthread_mutex_trylock
+#undef pthread_mutex_t
+#undef pthread_cond_t
+
+
/*****************************************************************************
** Patches for AIX and DEC OSF/1 3.2
*****************************************************************************/
#if (defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) && !defined(HAVE_UNIXWARE7_THREADS)) || defined(HAVE_DEC_3_2_THREADS)
-#undef pthread_mutex_init
-#undef pthread_cond_init
#include <netdb.h>
@@ -419,7 +437,6 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
****************************************************************************/
#if defined(HPUX) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT)
-#undef pthread_cond_timedwait
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime)
@@ -462,13 +479,13 @@ int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
RETURN VALUES
0 If we are able successfully lock the mutex.
EBUSY Mutex was locked by another thread
- != errno set by pthread_mutex_trylock()
+ # Other error number returned by pthread_mutex_trylock()
+ (Not likely)
*/
-#undef pthread_mutex_trylock
int my_pthread_mutex_trylock(pthread_mutex_t *mutex)
{
- int error=pthread_mutex_trylock(mutex);
+ int error= pthread_mutex_trylock(mutex);
if (error == 1)
return 0; /* Got lock on mutex */
if (error == 0) /* Someon else is locking mutex */