~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/scheduler.cc

merge latest from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
thd_scheduler::thd_scheduler()
103
103
  : logged_in(false), io_event(NULL), thread_attached(false)
104
104
{  
105
 
  dbug_explain_buf[0]= 0;
106
105
}
107
106
 
108
107
 
148
147
  my_errno= 0;
149
148
  thd->mysys_var->abort= 0;
150
149
  thread_attached= true;
151
 
  swap_dbug_explain();
 
150
 
152
151
  return false;
153
152
}
154
153
 
164
163
    THD* thd = (THD*)list.data;
165
164
    thd->mysys_var= NULL;
166
165
    thread_attached= false;
167
 
    swap_dbug_explain();
168
166
  }
169
167
}
170
168
 
171
 
 
172
 
/*
173
 
  Swap the THD's dbug explain_buffer with the OS thread's dbug explain buffer.
174
 
 
175
 
  This is used to preserve the SESSION DEBUG variable, which is mapped to the OS 
176
 
  thread during a command, but each command is handled by a different thread.
177
 
*/
178
 
void thd_scheduler::swap_dbug_explain()
179
 
{
180
 
  char buffer[sizeof(dbug_explain_buf)];
181
 
  memcpy(dbug_explain_buf, buffer, sizeof(buffer));
182
 
}
183
 
 
184
169
/**
185
170
  Create all threads for the thread pool
186
171