diff options
author | unknown <monty@hundin.mysql.fi> | 2002-08-16 14:41:22 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-08-16 14:41:22 +0300 |
commit | 7139794e299b9b9f118dbf4a9cddfbb027776983 (patch) | |
tree | 8877ea5d5b884ec2013f7d882aa020d79917ef74 /mysys/my_pthread.c | |
parent | 7eb0ae193bb59e98e9a0b24b037e2cc13c2c80f7 (diff) | |
parent | 50d24f36a58f2518bf052efdd2811babee654260 (diff) | |
download | mariadb-git-7139794e299b9b9f118dbf4a9cddfbb027776983.tar.gz |
merge with 3.23.53
New fix for pthread_mutex_trylock for HPUX 10.20
BitKeeper/deleted/.del-mysql.dsp:
Delete: VC++Files/mysql.dsp
BitKeeper/deleted/.del-mysqlshow.dsp:
Delete: VC++Files/client/mysqlshow.dsp
BitKeeper/deleted/.del-dbug.dsp:
Delete: VC++Files/dbug/dbug.dsp
BitKeeper/deleted/.del-dbug.dsw:
Delete: VC++Files/dbug/dbug.dsw
BitKeeper/deleted/.del-heap.dsp:
Delete: VC++Files/heap/heap.dsp
BitKeeper/deleted/.del-innobase.dsp:
Delete: VC++Files/innobase/innobase.dsp
BitKeeper/deleted/.del-isam.dsp:
Delete: VC++Files/isam/isam.dsp
BitKeeper/deleted/.del-isam.dsw:
Delete: VC++Files/isam/isam.dsw
BitKeeper/deleted/.del-isamchk.dsp:
Delete: VC++Files/isamchk/isamchk.dsp
BitKeeper/deleted/.del-libmySQL.dsp:
Delete: VC++Files/libmysql/libmySQL.dsp
BitKeeper/deleted/.del-libmysql.dsw:
Delete: VC++Files/libmysql/libmysql.dsw
BitKeeper/deleted/.del-mysql.dsw:
Delete: VC++Files/mysql.dsw
BitKeeper/deleted/.del-myTest.dsp:
Delete: VC++Files/libmysqltest/myTest.dsp
BitKeeper/deleted/.del-mytest.dsw:
Delete: VC++Files/libmysqltest/mytest.dsw
BitKeeper/deleted/.del-merge.dsp:
Delete: VC++Files/merge/merge.dsp
BitKeeper/deleted/.del-merge.dsw:
Delete: VC++Files/merge/merge.dsw
BitKeeper/deleted/.del-myisam.dsp:
Delete: VC++Files/myisam/myisam.dsp
BitKeeper/deleted/.del-myisamchk.dsp:
Delete: VC++Files/myisamchk/myisamchk.dsp
BitKeeper/deleted/.del-myisamlog.dsp:
Delete: VC++Files/myisamlog/myisamlog.dsp
BitKeeper/deleted/.del-myisammrg.dsp:
Delete: VC++Files/myisammrg/myisammrg.dsp
BitKeeper/deleted/.del-myisampack.dsp:
Delete: VC++Files/myisampack/myisampack.dsp
BitKeeper/deleted/.del-mysqlbinlog.dsp:
Delete: VC++Files/mysqlbinlog/mysqlbinlog.dsp
BitKeeper/deleted/.del-bdb.dsp:
Delete: VC++Files/bdb/bdb.dsp
BitKeeper/deleted/.del-MySqlManager.dsp:
Delete: VC++Files/mysqlmanager/MySqlManager.dsp
BitKeeper/deleted/.del-mysqlmanager.dsw:
Delete: VC++Files/mysqlmanager/mysqlmanager.dsw
BitKeeper/deleted/.del-myshutdown.dsp:
Delete: VC++Files/mysqlshutdown/myshutdown.dsp
BitKeeper/deleted/.del-mysqlshutdown.dsp:
Delete: VC++Files/mysqlshutdown/mysqlshutdown.dsp
BitKeeper/deleted/.del-mysqlwatch.dsp:
Delete: VC++Files/mysqlwatch/mysqlwatch.dsp
BitKeeper/deleted/.del-mysys.dsp:
Delete: VC++Files/mysys/mysys.dsp
BitKeeper/deleted/.del-mysys.dsw:
Delete: VC++Files/mysys/mysys.dsw
BitKeeper/deleted/.del-pack_isam.dsp:
Delete: VC++Files/pack_isam/pack_isam.dsp
BitKeeper/deleted/.del-perror.dsp:
Delete: VC++Files/perror/perror.dsp
BitKeeper/deleted/.del-regex.dsp:
Delete: VC++Files/regex/regex.dsp
BitKeeper/deleted/.del-mysql.dsp~1:
Delete: VC++Files/client/mysql.dsp
BitKeeper/deleted/.del-regex.dsw:
Delete: VC++Files/regex/regex.dsw
BitKeeper/deleted/.del-replace.dsp:
Delete: VC++Files/replace/replace.dsp
BitKeeper/deleted/.del-mysqld.dsp:
Delete: VC++Files/sql/mysqld.dsp
BitKeeper/deleted/.del-mysqldmax.dsp:
Delete: VC++Files/sql/mysqldmax.dsp
BitKeeper/deleted/.del-strings.dsp:
Delete: VC++Files/strings/noMASM/strings.dsp
BitKeeper/deleted/.del-test1.dsp:
Delete: VC++Files/test1/test1.dsp
BitKeeper/deleted/.del-thr_insert_test.dsp:
Delete: VC++Files/thr_insert_test/thr_insert_test.dsp
BitKeeper/deleted/.del-thr_test.dsp:
Delete: VC++Files/thr_test/thr_test.dsp
BitKeeper/deleted/.del-zlib.dsp~1:
Delete: VC++Files/zlib/zlib.dsp
BitKeeper/deleted/.del-mysqladmin.dsp:
Delete: VC++Files/client/mysqladmin.dsp
BitKeeper/deleted/.del-mysqlclient.dsp:
Delete: VC++Files/client/mysqlclient.dsp
BitKeeper/deleted/.del-mysqlclient.dsw:
Delete: VC++Files/client/mysqlclient.dsw
BitKeeper/deleted/.del-mysqldump.dsp:
Delete: VC++Files/client/mysqldump.dsp
BitKeeper/deleted/.del-global.h~e80d28157acfdcb5:
Auto merged
BitKeeper/deleted/.del-mysqlimport.dsp:
Delete: VC++Files/client/mysqlimport.dsp
Docs/manual.texi:
Auto merged
configure.in:
merge
mysys/my_pthread.c:
New fix for pthread_mutex_trylock for HPUX
sql-bench/Makefile.am:
merge with 3.23.53
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r-- | mysys/my_pthread.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index e10a8dec480..d9487de638e 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -437,25 +437,47 @@ int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, #endif -#ifdef HPUX +#ifdef HAVE_POSIX1003_4a_MUTEX /* 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 + + From the HP-UX-10.20 man page: + RETURN VALUES + If the function fails, errno may be set to one of the following + values: + Return | Error | Description + _______|__________|_________________________________________ + 1 | | Successful completion. + 0 | | The mutex is locked; therefore, it was + | | not acquired. + -1 | [EINVAL] | The value specified by mutex is invalid. + */ -#undef pthread_mutex_trylock +/* + Convert pthread_mutex_trylock to return values according to latest POSIX + + RETURN VALUES + 0 If we are able successfully lock the mutex. + EBUSY Mutex was locked by another thread + != errno set by pthread_mutex_trylock() +*/ + +#undef pthread_mutex_trylock int my_pthread_mutex_trylock(pthread_mutex_t *mutex) { int error=pthread_mutex_trylock(mutex); - if (error == 1) /* Safety if the lib is fixed */ - return 0; /* Mutex was locked */ + if (error == 1) + return 0; /* Got lock on mutex */ + if (error == 0) /* Someon else is locking mutex */ + return EBUSY; if (error == -1) /* Safety if the lib is fixed */ - error=errno; + error= errno; /* Probably invalid parameter */ return error; } -#endif - +#endif /* HAVE_POSIX1003_4a_MUTEX */ /* Some help functions */ |