Public Member Functions | |
EventQueue () | |
~EventQueue () | |
void | append_event (const Event &ev) |
bool | get_event (Event &ev) |
Definition at line 79 of file multi_thread_test.cpp.
EventQueue::EventQueue | ( | ) | [inline] |
Definition at line 82 of file multi_thread_test.cpp.
EventQueue::~EventQueue | ( | ) | [inline] |
Definition at line 86 of file multi_thread_test.cpp.
void EventQueue::append_event | ( | const Event & | ev | ) | [inline] |
Definition at line 91 of file multi_thread_test.cpp.
Referenced by EventHandler::handle_paginate_end(), EventHandler::handle_paginate_start(), EventHandler::handle_render_done(), and EventHandler::handle_search_done().
00092 { 00093 g_mutex_lock(mutex); 00094 event_queue.push_back(ev); 00095 g_mutex_unlock(mutex); 00096 }
bool EventQueue::get_event | ( | Event & | ev | ) | [inline] |
Definition at line 98 of file multi_thread_test.cpp.
Referenced by timeout_handler().
00099 { 00100 bool ret = false; 00101 g_mutex_lock(mutex); 00102 if (!event_queue.empty()) 00103 { 00104 ev = event_queue.front(); 00105 event_queue.pop_front(); 00106 ret = true; 00107 } 00108 g_mutex_unlock(mutex); 00109 return ret; 00110 }