Thrill
0.1
|
Implementation of request queue worker threads. Worker threads can be started by start_thread and stopped with stop_thread. The queue state is checked before termination and updated afterwards.
Definition at line 34 of file request_queue_impl_worker.hpp.
#include <request_queue_impl_worker.hpp>
Protected Types | |
enum | thread_state { NOT_RUNNING, RUNNING, TERMINATING, TERMINATED } |
Protected Member Functions | |
void | start_thread (void *(*worker)(void *), void *arg, std::thread &t, shared_state< thread_state > &s) |
void | stop_thread (std::thread &t, shared_state< thread_state > &s, tlx::semaphore &sem) |
Additional Inherited Members | |
Public Types inherited from request_queue | |
enum | priority_op { READ, WRITE, NONE } |
Public Member Functions inherited from request_queue | |
request_queue ()=default | |
request_queue (const request_queue &)=delete | |
non-copyable: delete copy-constructor More... | |
request_queue (request_queue &&)=default | |
move-constructor: default More... | |
virtual | ~request_queue () |
virtual void | add_request (request_ptr &req)=0 |
virtual bool | cancel_request (request_ptr &req)=0 |
request_queue & | operator= (const request_queue &)=delete |
non-copyable: delete assignment operator More... | |
request_queue & | operator= (request_queue &&)=default |
move-assignment operator: default More... | |
virtual void | set_priority_op (const priority_op &p) |
|
protected |
Enumerator | |
---|---|
NOT_RUNNING | |
RUNNING | |
TERMINATING | |
TERMINATED |
Definition at line 37 of file request_queue_impl_worker.hpp.
|
protected |
Definition at line 32 of file request_queue_impl_worker.cpp.
References request_queue_impl_worker::NOT_RUNNING, request_queue_impl_worker::RUNNING, and shared_state< ValueType >::set_to().
Referenced by request_queue_impl_1q::request_queue_impl_1q(), and request_queue_impl_qwqr::request_queue_impl_qwqr().
|
protected |
Definition at line 41 of file request_queue_impl_worker.cpp.
References request_queue_impl_worker::NOT_RUNNING, request_queue_impl_worker::RUNNING, shared_state< ValueType >::set_to(), Semaphore::signal(), request_queue_impl_worker::TERMINATED, and request_queue_impl_worker::TERMINATING.
Referenced by request_queue_impl_1q::~request_queue_impl_1q(), and request_queue_impl_qwqr::~request_queue_impl_qwqr().