~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pool_of_threads/pool_of_threads.cc

  • Committer: Brian Aker
  • Date: 2009-03-12 20:00:28 UTC
  • mfrom: (929.1.7 merge)
  • Revision ID: brian@tangent.org-20090312200028-lqywwjv6p5kwin1w
Merge from Brian (dead code in parser, change default scheduler)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
static volatile uint32_t created_threads= 0;
32
32
static volatile bool kill_pool_threads= false;
33
33
 
 
34
static pthread_attr_t thread_attrib;
 
35
 
34
36
static int deinit(void *);
35
37
 
36
38
static struct event session_add_event;
135
137
  {
136
138
    pthread_t thread;
137
139
    int error;
138
 
    if ((error= pthread_create(&thread, &connection_attrib,
139
 
                               libevent_thread_proc, 0)))
 
140
    if ((error= pthread_create(&thread, &thread_attrib, libevent_thread_proc, 0)))
140
141
    {
141
142
      errmsg_printf(ERRMSG_LVL_ERROR, _("Can't create completion port thread (error %d)"),
142
143
                      error);
583
584
  func->add_connection= add_connection;
584
585
  func->count= count_of_threads;
585
586
 
 
587
  /* Parameter for threads created for connections */
 
588
  (void) pthread_attr_init(&thread_attrib);
 
589
  (void) pthread_attr_setdetachstate(&thread_attrib,
 
590
                                     PTHREAD_CREATE_DETACHED);
 
591
  pthread_attr_setscope(&thread_attrib, PTHREAD_SCOPE_SYSTEM);
 
592
  {
 
593
    struct sched_param tmp_sched_param;
 
594
 
 
595
    memset(&tmp_sched_param, 0, sizeof(tmp_sched_param));
 
596
    tmp_sched_param.sched_priority= WAIT_PRIOR;
 
597
    (void)pthread_attr_setschedparam(&thread_attrib, &tmp_sched_param);
 
598
  }
 
599
 
586
600
  return (int)libevent_init();
587
601
}
588
602