Cbeam
|
Public Member Functions | |
TestThreadedObject (typename cbeam::concurrency::threaded_object< TestThreadedObject, int >::construction_token) | |
void | on_start () override |
void | on_exit () override |
Public Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int > | |
threaded_object ()=default | |
virtual | ~threaded_object () noexcept |
Destructor. Safely shuts down the managed thread by setting _running to false, notifying the condition variable, and then joining the thread.Catches and logs any std::system_error thrown by thread::join. Asserts in debug mode if such an exception is caught, as it indicates a serious bug that must be addressed. | |
Public Attributes | |
std::atomic< bool > | _has_run {false} |
std::atomic< bool > | _finished {false} |
Additional Inherited Members | |
Static Public Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int > | |
static std::unique_ptr< TestThreadedObject > | create (std::shared_ptr< std::mutex > mtx, std::shared_ptr< std::condition_variable > cv, Args &&... args) |
Protected Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int > | |
virtual bool | is_message_available () |
virtual int | get_message () |
virtual void | on_message (const int &) noexcept |
Protected Attributes inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int > | |
std::shared_ptr< std::mutex > | _mtx |
std::shared_ptr< std::condition_variable > | _cv |
|
inline |
|
inlineoverridevirtual |
Reimplemented from cbeam::concurrency::threaded_object< TestThreadedObject, int >.
|
inlineoverridevirtual |
Reimplemented from cbeam::concurrency::threaded_object< TestThreadedObject, int >.
std::atomic<bool> TestThreadedObject::_finished {false} |
std::atomic<bool> TestThreadedObject::_has_run {false} |