Commit c9442b67 authored by Mikael Ronstrom's avatar Mikael Ronstrom

WL#5138, review fixes

parent b6c1ecb3
...@@ -158,12 +158,12 @@ deinit_event_thread(THD *thd) ...@@ -158,12 +158,12 @@ deinit_event_thread(THD *thd)
DBUG_PRINT("exit", ("Event thread finishing")); DBUG_PRINT("exit", ("Event thread finishing"));
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thread_count--; thread_count--;
delete thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
my_atomic_rwlock_wrlock(&global_query_id_lock); my_atomic_rwlock_wrlock(&global_query_id_lock);
dec_thread_running(); dec_thread_running();
my_atomic_rwlock_wrunlock(&global_query_id_lock); my_atomic_rwlock_wrunlock(&global_query_id_lock);
delete thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
} }
...@@ -421,12 +421,12 @@ Event_scheduler::start() ...@@ -421,12 +421,12 @@ Event_scheduler::start()
net_end(&new_thd->net); net_end(&new_thd->net);
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thread_count--; thread_count--;
delete new_thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
my_atomic_rwlock_wrlock(&global_query_id_lock); my_atomic_rwlock_wrlock(&global_query_id_lock);
dec_thread_running(); dec_thread_running();
my_atomic_rwlock_wrunlock(&global_query_id_lock); my_atomic_rwlock_wrunlock(&global_query_id_lock);
delete new_thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
} }
end: end:
UNLOCK_DATA(); UNLOCK_DATA();
...@@ -556,12 +556,12 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) ...@@ -556,12 +556,12 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name)
net_end(&new_thd->net); net_end(&new_thd->net);
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thread_count--; thread_count--;
delete new_thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
my_atomic_rwlock_wrlock(&global_query_id_lock); my_atomic_rwlock_wrlock(&global_query_id_lock);
dec_thread_running(); dec_thread_running();
my_atomic_rwlock_wrunlock(&global_query_id_lock); my_atomic_rwlock_wrunlock(&global_query_id_lock);
delete new_thd;
pthread_cond_broadcast(&COND_thread_count);
pthread_mutex_unlock(&LOCK_thread_count);
} }
delete event_name; delete event_name;
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
...@@ -86,9 +86,9 @@ typedef ulong nesting_map; /* Used for flags of nesting constructs */ ...@@ -86,9 +86,9 @@ typedef ulong nesting_map; /* Used for flags of nesting constructs */
typedef ulonglong nested_join_map; typedef ulonglong nested_join_map;
/* query_id */ /* query_id */
typedef int64 query_id_t; typedef uint64 query_id_t;
extern query_id_t global_query_id; extern query_id_t global_query_id;
extern int32 thread_running; extern uint32 thread_running;
extern my_atomic_rwlock_t global_query_id_lock; extern my_atomic_rwlock_t global_query_id_lock;
/* increment query_id and return it. */ /* increment query_id and return it. */
......
...@@ -532,7 +532,7 @@ uint delay_key_write_options, protocol_version; ...@@ -532,7 +532,7 @@ uint delay_key_write_options, protocol_version;
uint lower_case_table_names; uint lower_case_table_names;
uint tc_heuristic_recover= 0; uint tc_heuristic_recover= 0;
uint volatile thread_count; uint volatile thread_count;
int32 thread_running; uint32 thread_running;
ulonglong thd_startup_options; ulonglong thd_startup_options;
ulong back_log, connect_timeout, concurrency, server_id; ulong back_log, connect_timeout, concurrency, server_id;
ulong table_cache_size, table_def_size; ulong table_cache_size, table_def_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment