summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.cc
diff options
context:
space:
mode:
authorunknown <andrey@example.com>2006-08-11 16:51:50 +0200
committerunknown <andrey@example.com>2006-08-11 16:51:50 +0200
commit3391899858d2acb0d18e036ff7208116eab58aca (patch)
tree70cf07a8ef55ab94db2e074b5589b13c412f3f63 /sql/event_scheduler.cc
parente69e640f2eedfe1247f2a5f536d8dc1cf8a48300 (diff)
downloadmariadb-git-3391899858d2acb0d18e036ff7208116eab58aca.tar.gz
Fix a crash of SHOW PROCESSLIST
sql/event_scheduler.cc: Fix a crash when calling show processlist and an event thread is starting. Don't add the thread to threads before it is fully initialized.
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r--sql/event_scheduler.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 6e3a7ec2be8..8385d89b0c9 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -123,6 +123,12 @@ post_init_event_thread(THD *thd)
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
#endif
+ pthread_mutex_lock(&LOCK_thread_count);
+ threads.append(thd);
+ thread_count++;
+ thread_running++;
+ pthread_mutex_unlock(&LOCK_thread_count);
+
return FALSE;
}
@@ -182,9 +188,6 @@ pre_init_event_thread(THD* thd)
thd->client_capabilities|= CLIENT_MULTI_RESULTS;
pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id= thread_id++;
- threads.append(thd);
- thread_count++;
- thread_running++;
pthread_mutex_unlock(&LOCK_thread_count);
/*