~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/single_thread/single_thread.cc

  • Committer: Brian Aker
  • Date: 2009-02-09 02:50:21 UTC
  • Revision ID: brian@tangent.org-20090209025021-84e62awsk93tiuva
Fix for error when thread/whatever can not be created on connection.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
using namespace std;
27
27
 
28
28
static bool isEnabled= false;
29
 
static bool init_dummy(void) {return 0;}
 
29
static bool init_new_connection_thread(void) {return 0;}
30
30
 
31
31
/*
32
32
  Simple scheduler that use the main thread to handle the request
38
38
  When we enter this function, LOCK_thread_count is held!
39
39
*/
40
40
 
41
 
void handle_connection_in_main_thread(Session *session)
 
41
bool add_connection(Session *session)
42
42
{
43
43
  safe_mutex_assert_owner(&LOCK_thread_count);
44
44
  (void) pthread_mutex_unlock(&LOCK_thread_count);
45
45
  handle_one_connection((void*) session);
 
46
 
 
47
  return false;
46
48
}
47
49
 
48
50
 
69
71
  func->is_used= true;
70
72
 
71
73
  func->max_threads= 1;
72
 
  func->add_connection= handle_connection_in_main_thread;
73
 
  func->init_new_connection_thread= init_dummy;
 
74
  func->add_connection= add_connection;
 
75
  func->init_new_connection_thread= init_new_connection_thread;
74
76
  func->end_thread= end_thread;
75
77
 
76
78
  return 0;