~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/scheduler.cc

  • Committer: Lee
  • Date: 2009-01-06 20:24:58 UTC
  • mfrom: (759 drizzle)
  • mto: This revision was merged to the branch mainline in revision 763.
  • Revision ID: lbieber@lbieber-desktop-20090106202458-82n4kyftrnakvl4r
merge with latest from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
 
130
130
  if (io_event == NULL)
131
131
  {
132
 
    sql_print_error(_("Memory allocation error in session_scheduler::init\n"));
 
132
    errmsg_printf(ERRMSG_LVL_ERROR, _("Memory allocation error in session_scheduler::init\n"));
133
133
    return true;
134
134
  }
135
135
  memset(io_event, 0, sizeof(*io_event));
207
207
  /* set up the pipe used to add new sessions to the event pool */
208
208
  if (init_pipe(session_add_pipe))
209
209
  {
210
 
    sql_print_error(_("init_pipe(session_add_pipe) error in libevent_init\n"));
 
210
    errmsg_printf(ERRMSG_LVL_ERROR, _("init_pipe(session_add_pipe) error in libevent_init\n"));
211
211
    return(1);
212
212
  }
213
213
  /* set up the pipe used to kill sessions in the event queue */
214
214
  if (init_pipe(session_kill_pipe))
215
215
  {
216
 
    sql_print_error(_("init_pipe(session_kill_pipe) error in libevent_init\n"));
 
216
    errmsg_printf(ERRMSG_LVL_ERROR, _("init_pipe(session_kill_pipe) error in libevent_init\n"));
217
217
    close(session_add_pipe[0]);
218
218
    close(session_add_pipe[1]);
219
219
    return(1);
225
225
 
226
226
 if (event_add(&session_add_event, NULL) || event_add(&session_kill_event, NULL))
227
227
 {
228
 
   sql_print_error(_("session_add_event event_add error in libevent_init\n"));
 
228
   errmsg_printf(ERRMSG_LVL_ERROR, _("session_add_event event_add error in libevent_init\n"));
229
229
   libevent_end();
230
230
   return(1);
231
231
 
241
241
    if ((error= pthread_create(&thread, &connection_attrib,
242
242
                               libevent_thread_proc, 0)))
243
243
    {
244
 
      sql_print_error(_("Can't create completion port thread (error %d)"),
 
244
      errmsg_printf(ERRMSG_LVL_ERROR, _("Can't create completion port thread (error %d)"),
245
245
                      error);
246
246
      pthread_mutex_unlock(&LOCK_thread_count);
247
247
      libevent_end();                      // Cleanup
354
354
      /* Add to libevent */
355
355
      if (event_add(session->scheduler.io_event, NULL))
356
356
      {
357
 
        sql_print_error(_("event_add error in libevent_add_session_callback\n"));
 
357
        errmsg_printf(ERRMSG_LVL_ERROR, _("event_add error in libevent_add_session_callback\n"));
358
358
        libevent_connection_close(session);
359
359
      }
360
360
      else
380
380
{
381
381
  if (session->scheduler.init(session))
382
382
  {
383
 
    sql_print_error(_("Scheduler init error in libevent_add_new_connection\n"));
 
383
    errmsg_printf(ERRMSG_LVL_ERROR, _("Scheduler init error in libevent_add_new_connection\n"));
384
384
    pthread_mutex_unlock(&LOCK_thread_count);
385
385
    libevent_connection_close(session);
386
386
    return;
461
461
  if (init_new_connection_handler_thread())
462
462
  {
463
463
    my_thread_global_end();
464
 
    sql_print_error(_("libevent_thread_proc: my_thread_init() failed\n"));
 
464
    errmsg_printf(ERRMSG_LVL_ERROR, _("libevent_thread_proc: my_thread_init() failed\n"));
465
465
    exit(1);
466
466
  }
467
467