diff options
author | unknown <monty@donna.mysql.fi> | 2001-03-26 01:05:04 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-03-26 01:05:04 +0300 |
commit | e7e243ed035a71666e07dd5767536783919764ed (patch) | |
tree | 560b5f590ad8a9084b786e4947eb05bfce93fd35 | |
parent | 92d0009452b6e4480440d4a614654b057419f6e6 (diff) | |
download | mariadb-git-e7e243ed035a71666e07dd5767536783919764ed.tar.gz |
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
(For glibc 2.2)
client/thread_test.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
dbug/dbug.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
heap/hp_open.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
isam/open.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
myisam/mi_open.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
mysys/thr_alarm.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
mysys/thr_lock.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
mysys/thr_rwlock.c:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/ha_berkeley.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/ha_innobase.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/hash_filo.h:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/hostname.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/item_func.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/log.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/mysqld.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/slave.h:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/sql_class.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/sql_class.h:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/sql_insert.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
sql/sql_udf.cc:
Changed pthread_mutex_init() to use new MY_MUTEX_INIT.. macro
-rw-r--r-- | client/thread_test.c | 2 | ||||
-rw-r--r-- | dbug/dbug.c | 2 | ||||
-rw-r--r-- | heap/hp_open.c | 2 | ||||
-rw-r--r-- | isam/open.c | 2 | ||||
-rw-r--r-- | myisam/mi_open.c | 2 | ||||
-rw-r--r-- | mysys/thr_alarm.c | 4 | ||||
-rw-r--r-- | mysys/thr_lock.c | 4 | ||||
-rw-r--r-- | mysys/thr_rwlock.c | 2 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 4 | ||||
-rw-r--r-- | sql/ha_innobase.cc | 4 | ||||
-rw-r--r-- | sql/hash_filo.h | 2 | ||||
-rw-r--r-- | sql/hostname.cc | 2 | ||||
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 40 | ||||
-rw-r--r-- | sql/slave.h | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 2 | ||||
-rw-r--r-- | sql/sql_udf.cc | 2 |
20 files changed, 44 insertions, 44 deletions
diff --git a/client/thread_test.c b/client/thread_test.c index c76489ed946..4d3ae6e7ddd 100644 --- a/client/thread_test.c +++ b/client/thread_test.c @@ -229,7 +229,7 @@ int main(int argc, char **argv) error,errno); exit(1); } - pthread_mutex_init(&LOCK_thread_count,NULL); + pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); if ((error=pthread_attr_init(&thr_attr))) { diff --git a/dbug/dbug.c b/dbug/dbug.c index c004de587f2..f600b281007 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -341,7 +341,7 @@ pthread_mutex_t THR_LOCK_dbug; static void init_dbug_state(void) { - pthread_mutex_init(&THR_LOCK_dbug,NULL); + pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST); } static CODE_STATE *code_state(void) diff --git a/heap/hp_open.c b/heap/hp_open.c index 3040da50484..692142de14a 100644 --- a/heap/hp_open.c +++ b/heap/hp_open.c @@ -88,7 +88,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef, } #ifdef THREAD thr_lock_init(&share->lock); - VOID(pthread_mutex_init(&share->intern_lock,NULL)); + VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST)); #endif share->open_list.data=(void*) share; heap_share_list=list_add(heap_share_list,&share->open_list); diff --git a/isam/open.c b/isam/open.c index 8a6e0eb5814..a3ede4512b9 100644 --- a/isam/open.c +++ b/isam/open.c @@ -270,7 +270,7 @@ N_INFO *nisam_open(const char *name, int mode, uint handle_locking) setup_functions(share); #ifdef THREAD thr_lock_init(&share->lock); - VOID(pthread_mutex_init(&share->intern_lock,NULL)); + VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST)); #endif } else diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 0280355ae72..de1888bc9b7 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -393,7 +393,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) setup_functions(share); #ifdef THREAD thr_lock_init(&share->lock); - VOID(pthread_mutex_init(&share->intern_lock,NULL)); + VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST)); for (i=0; i<keys; i++) VOID(my_rwlock_init(&share->key_root_lock[i], NULL)); if (!thr_lock_inited) 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 ); diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 10ff4dcc260..9dbd7b6c998 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -171,7 +171,7 @@ bool berkeley_init(void) (void) hash_init(&bdb_open_tables,32,0,0, (hash_get_key) bdb_get_key,0,0); - pthread_mutex_init(&bdb_mutex,NULL); + pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST); DBUG_RETURN(db_env == 0); } @@ -2151,7 +2151,7 @@ static BDB_SHARE *get_share(const char *table_name, TABLE *table) return 0; /* purecov: inspected */ } thr_lock_init(&share->lock); - pthread_mutex_init(&share->mutex,NULL); + pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST); } } pthread_mutex_unlock(&bdb_mutex); diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index d509e696806..cd8e1533e78 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -476,7 +476,7 @@ innobase_init(void) } (void) hash_init(&innobase_open_tables,32,0,0, (hash_get_key) innobase_get_key,0,0); - pthread_mutex_init(&innobase_mutex,NULL); + pthread_mutex_init(&innobase_mutex,MY_MUTEX_INIT_FAST); DBUG_RETURN(0); } @@ -2642,7 +2642,7 @@ static INNOBASE_SHARE *get_share(const char *table_name) return 0; } thr_lock_init(&share->lock); - pthread_mutex_init(&share->mutex,NULL); + pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST); } } share->use_count++; diff --git a/sql/hash_filo.h b/sql/hash_filo.h index 7d659f706a3..157c2739add 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -70,7 +70,7 @@ public: if (!init) { init=1; - (void) pthread_mutex_init(&lock,NULL); + (void) pthread_mutex_init(&lock,MY_MUTEX_INIT_FAST); } if (!locked) (void) pthread_mutex_lock(&lock); diff --git a/sql/hostname.cc b/sql/hostname.cc index 90938c41ee9..fed9e60b574 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -57,7 +57,7 @@ void hostname_cache_refresh() bool hostname_cache_init() { - (void) pthread_mutex_init(&LOCK_hostname,NULL); + (void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW); if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE,offsetof(host_entry,ip), sizeof(struct in_addr),NULL, (void (*)(void*)) free))) diff --git a/sql/item_func.cc b/sql/item_func.cc index 61e64be1e74..6c4e3e34fe3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1370,7 +1370,7 @@ char *ull_get_key(const ULL *ull,uint *length, void item_user_lock_init(void) { - pthread_mutex_init(&LOCK_user_locks,NULL); + pthread_mutex_init(&LOCK_user_locks,MY_MUTEX_INIT_SLOW); hash_init(&hash_user_locks,16,0,0,(hash_get_key) ull_get_key,NULL,0); } diff --git a/sql/log.cc b/sql/log.cc index 2d3a8bd062b..9601d162d28 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -141,8 +141,8 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, if (!inited) { inited=1; - (void) pthread_mutex_init(&LOCK_log,NULL); - (void) pthread_mutex_init(&LOCK_index, NULL); + (void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW); if (log_type_arg == LOG_BIN && *fn_ext(log_name)) no_rotate = 1; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f4649a792b4..9c8e28e19f0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1568,31 +1568,31 @@ int main(int argc, char **argv) /* These must be set early */ + (void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_grant,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_open,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_delayed_insert,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_delayed_status,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW); + (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_timezone,MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_binlog_update, MY_MUTEX_INIT_FAST); // QQ NOT USED + (void) pthread_mutex_init(&LOCK_slave, MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_server_id, MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST); (void) pthread_cond_init(&COND_thread_count,NULL); - (void) pthread_mutex_init(&LOCK_mysql_create_db,NULL); - (void) pthread_mutex_init(&LOCK_Acl,NULL); - (void) pthread_mutex_init(&LOCK_grant,NULL); - (void) pthread_mutex_init(&LOCK_open,NULL); - (void) pthread_mutex_init(&LOCK_thread_count,NULL); - (void) pthread_mutex_init(&LOCK_mapped_file,NULL); - (void) pthread_mutex_init(&LOCK_status,NULL); - (void) pthread_mutex_init(&LOCK_error_log,NULL); - (void) pthread_mutex_init(&LOCK_delayed_insert,NULL); - (void) pthread_mutex_init(&LOCK_delayed_status,NULL); - (void) pthread_mutex_init(&LOCK_delayed_create,NULL); (void) pthread_cond_init(&COND_refresh,NULL); (void) pthread_cond_init(&COND_thread_cache,NULL); (void) pthread_cond_init(&COND_flush_thread_cache,NULL); (void) pthread_cond_init(&COND_manager,NULL); - (void) pthread_mutex_init(&LOCK_manager,NULL); - (void) pthread_mutex_init(&LOCK_crypt,NULL); - (void) pthread_mutex_init(&LOCK_bytes_sent,NULL); - (void) pthread_mutex_init(&LOCK_bytes_received,NULL); - (void) pthread_mutex_init(&LOCK_timezone,NULL); - (void) pthread_mutex_init(&LOCK_binlog_update, NULL); - (void) pthread_mutex_init(&LOCK_slave, NULL); - (void) pthread_mutex_init(&LOCK_server_id, NULL); - (void) pthread_mutex_init(&LOCK_user_conn, NULL); (void) pthread_cond_init(&COND_binlog_update, NULL); (void) pthread_cond_init(&COND_slave_stopped, NULL); (void) pthread_cond_init(&COND_slave_start, NULL); diff --git a/sql/slave.h b/sql/slave.h index 048cb3f0100..311368a4b82 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -20,7 +20,7 @@ typedef struct st_master_info st_master_info():pending(0),fd(-1),inited(0) { host[0] = 0; user[0] = 0; password[0] = 0; - pthread_mutex_init(&lock, NULL); + pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST); pthread_cond_init(&cond, NULL); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 60622f0124c..d4c7f77f94a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -110,7 +110,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), #endif #ifdef SIGNAL_WITH_VIO_CLOSE active_vio = 0; - pthread_mutex_init(&active_vio_lock, NULL); + pthread_mutex_init(&active_vio_lock, MY_MUTEX_INIT_FAST); #endif /* Variables with default values */ diff --git a/sql/sql_class.h b/sql/sql_class.h index ef7fe073f5a..297b6acbad5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -45,7 +45,7 @@ typedef struct st_log_info my_off_t pos; bool fatal; // if the purge happens to give us a negative offset pthread_mutex_t lock; - st_log_info():fatal(0) { pthread_mutex_init(&lock, NULL);} + st_log_info():fatal(0) { pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST);} ~st_log_info() { pthread_mutex_destroy(&lock);} } LOG_INFO; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 37933f58162..d2e7c98333d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -498,7 +498,7 @@ public: bzero((char*) &thd.net,sizeof(thd.net)); // Safety thd.system_thread=1; bzero((char*) &info,sizeof(info)); - pthread_mutex_init(&mutex,NULL); + pthread_mutex_init(&mutex,MY_MUTEX_INIT_FAST); pthread_cond_init(&cond,NULL); pthread_cond_init(&cond_client,NULL); VOID(pthread_mutex_lock(&LOCK_thread_count)); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 75d796faf5e..e5a0f6a40b6 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -105,7 +105,7 @@ void udf_init() if (initialized) DBUG_VOID_RETURN; - pthread_mutex_init(&THR_LOCK_udf,NULL); + pthread_mutex_init(&THR_LOCK_udf,MY_MUTEX_INIT_SLOW); init_sql_alloc(&mem, 1024,0); THD *new_thd = new THD; |