Skip to content

Commit add70fc

Browse files
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
(For glibc 2.2)
1 parent 76e5908 commit add70fc

File tree

20 files changed

+44
-44
lines changed

20 files changed

+44
-44
lines changed

client/thread_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int main(int argc, char **argv)
229229
error,errno);
230230
exit(1);
231231
}
232-
pthread_mutex_init(&LOCK_thread_count,NULL);
232+
pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
233233

234234
if ((error=pthread_attr_init(&thr_attr)))
235235
{

dbug/dbug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pthread_mutex_t THR_LOCK_dbug;
341341

342342
static void init_dbug_state(void)
343343
{
344-
pthread_mutex_init(&THR_LOCK_dbug,NULL);
344+
pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST);
345345
}
346346

347347
static CODE_STATE *code_state(void)

heap/hp_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
8888
}
8989
#ifdef THREAD
9090
thr_lock_init(&share->lock);
91-
VOID(pthread_mutex_init(&share->intern_lock,NULL));
91+
VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST));
9292
#endif
9393
share->open_list.data=(void*) share;
9494
heap_share_list=list_add(heap_share_list,&share->open_list);

isam/open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ N_INFO *nisam_open(const char *name, int mode, uint handle_locking)
270270
setup_functions(share);
271271
#ifdef THREAD
272272
thr_lock_init(&share->lock);
273-
VOID(pthread_mutex_init(&share->intern_lock,NULL));
273+
VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST));
274274
#endif
275275
}
276276
else

myisam/mi_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
393393
setup_functions(share);
394394
#ifdef THREAD
395395
thr_lock_init(&share->lock);
396-
VOID(pthread_mutex_init(&share->intern_lock,NULL));
396+
VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST));
397397
for (i=0; i<keys; i++)
398398
VOID(my_rwlock_init(&share->key_root_lock[i], NULL));
399399
if (!thr_lock_inited)

mysys/thr_alarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void init_thr_alarm(uint max_alarms)
7171
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
7272
compare_ulong,NullS);
7373
sigfillset(&full_signal_set); /* Neaded to block signals */
74-
pthread_mutex_init(&LOCK_alarm,NULL);
74+
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
7575
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
7676
#if defined(HAVE_mit_thread)
7777
sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */
@@ -862,7 +862,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
862862
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#')
863863
DBUG_PUSH(argv[1]+2);
864864

865-
pthread_mutex_init(&LOCK_thread_count,NULL);
865+
pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
866866
pthread_cond_init(&COND_thread_count,NULL);
867867

868868
/* Start a alarm handling thread */

mysys/thr_lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void thr_lock_init(THR_LOCK *lock)
288288
{
289289
DBUG_ENTER("thr_lock_init");
290290
bzero((char*) lock,sizeof(*lock));
291-
VOID(pthread_mutex_init(&lock->mutex,NULL));
291+
VOID(pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST));
292292
lock->read.last= &lock->read.data;
293293
lock->read_wait.last= &lock->read_wait.data;
294294
lock->write_wait.last= &lock->write_wait.data;
@@ -1218,7 +1218,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
12181218
error,errno);
12191219
exit(1);
12201220
}
1221-
if ((error=pthread_mutex_init(&LOCK_thread_count,NULL)))
1221+
if ((error=pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST)))
12221222
{
12231223
fprintf(stderr,"Got error: %d from pthread_cond_init (errno: %d)",
12241224
error,errno);

mysys/thr_rwlock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int my_rwlock_init( rw_lock_t *rwp, void *arg __attribute__((unused)))
6363
{
6464
pthread_condattr_t cond_attr;
6565

66-
pthread_mutex_init( &rwp->lock, NULL );
66+
pthread_mutex_init( &rwp->lock, MY_MUTEX_INIT_FAST);
6767
pthread_condattr_init( &cond_attr );
6868
pthread_cond_init( &rwp->readers, &cond_attr );
6969
pthread_cond_init( &rwp->writers, &cond_attr );

sql/ha_berkeley.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ bool berkeley_init(void)
171171

172172
(void) hash_init(&bdb_open_tables,32,0,0,
173173
(hash_get_key) bdb_get_key,0,0);
174-
pthread_mutex_init(&bdb_mutex,NULL);
174+
pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST);
175175
DBUG_RETURN(db_env == 0);
176176
}
177177

@@ -2151,7 +2151,7 @@ static BDB_SHARE *get_share(const char *table_name, TABLE *table)
21512151
return 0; /* purecov: inspected */
21522152
}
21532153
thr_lock_init(&share->lock);
2154-
pthread_mutex_init(&share->mutex,NULL);
2154+
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
21552155
}
21562156
}
21572157
pthread_mutex_unlock(&bdb_mutex);

sql/ha_innobase.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ innobase_init(void)
476476
}
477477
(void) hash_init(&innobase_open_tables,32,0,0,
478478
(hash_get_key) innobase_get_key,0,0);
479-
pthread_mutex_init(&innobase_mutex,NULL);
479+
pthread_mutex_init(&innobase_mutex,MY_MUTEX_INIT_FAST);
480480
DBUG_RETURN(0);
481481
}
482482

@@ -2642,7 +2642,7 @@ static INNOBASE_SHARE *get_share(const char *table_name)
26422642
return 0;
26432643
}
26442644
thr_lock_init(&share->lock);
2645-
pthread_mutex_init(&share->mutex,NULL);
2645+
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
26462646
}
26472647
}
26482648
share->use_count++;

0 commit comments

Comments
 (0)