diff options
author | unknown <monty@hundin.mysql.fi> | 2002-08-17 00:35:51 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-08-17 00:35:51 +0300 |
commit | 96f2e21e99394352ad062ae788e70a17a788f92c (patch) | |
tree | a5bba2df04761e778b4e626fc71182b2708f85ff /mysys/my_pthread.c | |
parent | 7139794e299b9b9f118dbf4a9cddfbb027776983 (diff) | |
download | mariadb-git-96f2e21e99394352ad062ae788e70a17a788f92c.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
Docs/manual.texi:
Changelog
include/my_pthread.h:
Fix for pthread_mutex_trylock when used with SAFEMUTEX
include/violite.h:
Fixed bug in blocking handling when compiling with OPENSSL (caused hangup in client code)
innobase/buf/buf0buf.c:
Fixed wrong format string
libmysqld/lib_sql.cc:
Fixed hangup in embedded server.
mysql-test/r/distinct.result:
Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column
mysql-test/t/distinct.test:
Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column
mysys/my_pthread.c:
Cleanup of pthread_xxx rewrite code.
Fixed bug in pthread_mutex_trylock with HPUX 11.0
sql/gen_lex_hash.cc:
Smaller hash array
sql/mysqld.cc:
Fixed hangup in embedded server.
sql/sql_select.cc:
Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column
vio/vio.c:
Added vio_ssl_blocking
vio/viossl.c:
Added vio_ssl_blocking
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r-- | mysys/my_pthread.c | 31 |
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 */ |