mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
cleanup: thread_count
move thread_count handling into THD: * increment thread_count in THD constructor * decrement thread_count in THD destructor * never modify thread_count directly!
This commit is contained in:
@ -310,7 +310,6 @@ dbcontext::init_thread(const void *stack_bottom, volatile int& shutdown_flag)
|
||||
}
|
||||
{
|
||||
thd->thread_id = next_thread_id();
|
||||
thread_safe_increment32(&thread_count);
|
||||
add_to_active_threads(thd);
|
||||
}
|
||||
|
||||
@ -348,7 +347,6 @@ dbcontext::term_thread()
|
||||
pthread_mutex_lock(&LOCK_thread_count);
|
||||
delete thd;
|
||||
thd = 0;
|
||||
--thread_count;
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
my_thread_end();
|
||||
}
|
||||
|
Reference in New Issue
Block a user