~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-02-02 23:10:18 UTC
  • mfrom: (779.3.40 devel)
  • Revision ID: brian@tangent.org-20090202231018-zlp0hka6kgwy1vfy
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
static LIST *sessions_need_processing; /* list of sessions that needs some processing */
48
48
static LIST *sessions_waiting_for_io; /* list of sessions with added events */
49
49
 
50
 
pthread_handler_t libevent_thread_proc(void *arg);
51
50
static void libevent_end();
52
51
static bool libevent_needs_immediate_processing(Session *session);
53
52
static void libevent_connection_close(Session *session);
54
53
void libevent_session_add(Session* session);
55
54
bool libevent_should_close_connection(Session* session);
56
 
void libevent_io_callback(int Fd, short Operation, void *ctx);
57
 
void libevent_add_session_callback(int Fd, short Operation, void *ctx);
58
 
void libevent_kill_session_callback(int Fd, short Operation, void *ctx);
 
55
extern "C" {
 
56
  pthread_handler_t libevent_thread_proc(void *arg);
 
57
  void libevent_io_callback(int Fd, short Operation, void *ctx);
 
58
  void libevent_add_session_callback(int Fd, short Operation, void *ctx);
 
59
  void libevent_kill_session_callback(int Fd, short Operation, void *ctx);
 
60
}
59
61
 
60
62
static uint32_t size= 0;
61
63
 
69
71
  int flags;
70
72
  return pipe(pipe_fds) < 0 ||
71
73
          (flags= fcntl(pipe_fds[0], F_GETFL)) == -1 ||
72
 
          fcntl(pipe_fds[0], F_SETFL, flags | O_NONBLOCK) == -1;
 
74
          fcntl(pipe_fds[0], F_SETFL, flags | O_NONBLOCK) == -1 ||
73
75
          (flags= fcntl(pipe_fds[1], F_GETFL)) == -1 ||
74
76
          fcntl(pipe_fds[1], F_SETFL, flags | O_NONBLOCK) == -1;
75
77
}
372
374
  These procs only return/terminate on shutdown (kill_pool_threads == true).
373
375
*/
374
376
 
375
 
pthread_handler_t libevent_thread_proc(void *arg __attribute__((unused)))
 
377
pthread_handler_t libevent_thread_proc(void *)
376
378
{
377
379
  if (init_new_connection_handler_thread())
378
380
  {