26
26
using namespace std;
28
static bool init_new_connection_thread(void) {return 0;}
31
Simple scheduler that use the main thread to handle the request
34
This is only used for debugging, when starting mysqld with
35
--thread-handling=no-threads or --one-thread
37
When we enter this function, LOCK_thread_count is held!
40
bool add_connection(Session *session)
42
handle_one_connection((void*) session);
49
End connection, in case when we are using 'no-threads'
52
static bool end_thread(Session *session, bool)
54
unlink_session(session); /* locks LOCK_thread_count and deletes session */
56
return true; // Abort handle_one_connection
60
static uint32_t count_of_threads(void)
28
class Single_thread_scheduler : public Scheduler
31
Single_thread_scheduler(uint32_t threads): Scheduler(threads) {}
33
virtual bool init_new_connection_thread(void) {return 0;}
36
Simple scheduler that use the main thread to handle the request
39
This is only used for debugging, when starting mysqld with
40
--thread-handling=no-threads or --one-thread
42
When we enter this function, LOCK_thread_count is held!
45
virtual bool add_connection(Session *session)
47
handle_one_connection((void*) session);
54
End connection, in case when we are using 'no-threads'
57
virtual bool end_thread(Session *session, bool)
59
unlink_session(session); /* locks LOCK_thread_count and deletes session */
61
return true; // Abort handle_one_connection
65
virtual uint32_t count(void)
66
72
static int init(void *p)
68
scheduling_st* func= (scheduling_st *)p;
71
func->add_connection= add_connection;
72
func->init_new_connection_thread= init_new_connection_thread;
73
func->end_thread= end_thread;
74
func->count= count_of_threads;
74
Scheduler **sched= static_cast<Scheduler **>(p);
75
*sched= new Single_thread_scheduler(1);
79
static int deinit(void *)
80
static int deinit(void *p)
82
Scheduler *sched= static_cast<Scheduler *>(p);