Home / Open source / Terimber 2.0
thread Class Referencesafe thread class
More...
#include <thread.h>
List of all members.
Detailed Description
safe thread class
Definition at line 107 of file thread.h.
Constructor & Destructor Documentation
thread::thread |
( |
const thread & |
x |
) |
[private] |
copy constructor
prevents the copying of objects
Member Function Documentation
BEGIN_TERIMBER_NAMESPACE unsigned int __stdcall thread::start_thread |
( |
void * |
data |
) |
[static, private] |
bool thread::inside_thread |
( |
|
) |
const [private] |
starts thread, return false if thread already started
Definition at line 143 of file thread.cpp.
References _ev_end, _ev_start, _handle, change_state(), inside_thread(), event::nonsignal(), start_thread(), THREAD_CLOSE, THREAD_STARTING, and event::wait().
Referenced by dbserver_impl::_start_thread(), timer::activate(), thread_creator::activate(), thread_creator::create(), threadpool::on(), aiosock::on(), aiogate::on(), and aiofile::on().
bool thread::assign_job |
( |
const job_task & |
job_task |
) |
|
assigns new employer - thread safe, returns false if pointer is null or thread is not running user has to call wakeup function to activate thread
- Parameters:
-
Definition at line 177 of file thread.cpp.
References _ev_wakeup, _job_task, _mtx_job, _state, inside_thread(), event::signal(), THREAD_RUNNING, THREAD_SLEEPING, and mutex_keeper::unlock().
Referenced by dbserver_impl::_start_thread(), timer::activate(), thread_creator::activate(), threadpool::on(), aiosock::on(), aiogate::on(), and aiofile::on().
bool thread::cancel_job |
( |
|
) |
|
cancels current job - thread safe, returns false if thread is not running
Definition at line 202 of file thread.cpp.
References _ev_wakeup, _job_task, _mtx_job, _state, job_task::clear(), inside_thread(), event::signal(), THREAD_RUNNING, THREAD_SLEEPING, and mutex_keeper::unlock().
Referenced by thread_creator::back(), dbserver_impl::close_sql(), timer::deactivate(), dbserver_impl::interrupt_request(), threadpool::off(), aiosock::off(), aiogate::off(), aiofile::off(), dbserver_impl::v_do_job(), and dbserver_impl::~dbserver_impl().
stops thread, returns false if thread already stopped
Definition at line 228 of file thread.cpp.
References _ev_end, _ev_wakeup, _handle, change_state(), inside_thread(), event::signal(), THREAD_CLOSE, THREAD_STOPPING, and event::wait().
Referenced by timer::deactivate(), thread_creator::deactivate(), threadpool::off(), aiosock::off(), aiogate::off(), aiofile::off(), dbserver_impl::~dbserver_impl(), and ~thread().
void thread::wakeup |
( |
|
) |
const |
signals thread to wakeup, if thread is in waiting state
Definition at line 269 of file thread.cpp.
References _ev_wakeup, and event::signal().
Referenced by aiosock::_activate_block(), aiofile::_activate_block(), threadpool::_clean_up_clients(), dbserver_impl::_start_thread(), threadpool::borrow_from_range(), threadpool::borrow_thread(), aiogate::initiate_close(), aiosock::listen(), and aiosock::v_do_job().
bool thread::change_state |
( |
thread_state |
new_state |
) |
[private] |
bool thread::execute |
( |
|
) |
[private] |
bool thread::sleep |
( |
|
) |
[private] |
Member Data Documentation
The documentation for this class was generated from the following files:
|
|