summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@donna.mysql.fi <>2001-03-26 01:05:04 +0300
committermonty@donna.mysql.fi <>2001-03-26 01:05:04 +0300
commitadd70fc1ba71015c75e97da9380cb2385cd112fe (patch)
tree560b5f590ad8a9084b786e4947eb05bfce93fd35 /mysys
parent76e59081a05259623282f478ee8249eb341766f9 (diff)
downloadmariadb-git-add70fc1ba71015c75e97da9380cb2385cd112fe.tar.gz
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
(For glibc 2.2)
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_alarm.c4
-rw-r--r--mysys/thr_lock.c4
-rw-r--r--mysys/thr_rwlock.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 09928079eaa..3c641e01d7b 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -71,7 +71,7 @@ void init_thr_alarm(uint max_alarms)
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
compare_ulong,NullS);
sigfillset(&full_signal_set); /* Neaded to block signals */
- pthread_mutex_init(&LOCK_alarm,NULL);
+ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
#if defined(HAVE_mit_thread)
sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */
@@ -862,7 +862,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#')
DBUG_PUSH(argv[1]+2);
- pthread_mutex_init(&LOCK_thread_count,NULL);
+ pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_thread_count,NULL);
/* Start a alarm handling thread */
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 2cd920245e2..ed21d466b35 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -288,7 +288,7 @@ void thr_lock_init(THR_LOCK *lock)
{
DBUG_ENTER("thr_lock_init");
bzero((char*) lock,sizeof(*lock));
- VOID(pthread_mutex_init(&lock->mutex,NULL));
+ VOID(pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST));
lock->read.last= &lock->read.data;
lock->read_wait.last= &lock->read_wait.data;
lock->write_wait.last= &lock->write_wait.data;
@@ -1218,7 +1218,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
error,errno);
exit(1);
}
- if ((error=pthread_mutex_init(&LOCK_thread_count,NULL)))
+ if ((error=pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST)))
{
fprintf(stderr,"Got error: %d from pthread_cond_init (errno: %d)",
error,errno);
diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c
index 37630956e7f..866948a1c23 100644
--- a/mysys/thr_rwlock.c
+++ b/mysys/thr_rwlock.c
@@ -63,7 +63,7 @@ int my_rwlock_init( rw_lock_t *rwp, void *arg __attribute__((unused)))
{
pthread_condattr_t cond_attr;
- pthread_mutex_init( &rwp->lock, NULL );
+ pthread_mutex_init( &rwp->lock, MY_MUTEX_INIT_FAST);
pthread_condattr_init( &cond_attr );
pthread_cond_init( &rwp->readers, &cond_attr );
pthread_cond_init( &rwp->writers, &cond_attr );