summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_berkeley.cc4
-rw-r--r--sql/ha_innobase.cc4
-rw-r--r--sql/hash_filo.h2
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/log.cc4
-rw-r--r--sql/mysqld.cc40
-rw-r--r--sql/slave.h2
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_udf.cc2
12 files changed, 34 insertions, 34 deletions
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;