IRSOL
C++ code implementing socket server for interacting with Baumer camera.
state.cpp
Go to the documentation of this file.
2
3namespace irsol {
4namespace server {
5namespace internal {
6
7bool
9{
10 return m_running.load();
11}
12
13void
15{
16 std::scoped_lock<std::mutex> lock(m_threadMutex);
17 if(m_stopRequested) {
18 m_stopRequested->store(true);
19 }
20}
21
22}
23}
24}
Defines session-specific internal state structures for connected clients.
void stop()
Requests the active thread (if any) to stop by setting the stop flag.
Definition state.cpp:14
std::shared_ptr< std::atomic< bool > > m_stopRequested
Shared stop token used to cancel the thread's task loop.
Definition state.hpp:146
std::atomic< bool > m_running
Internal flag indicating whether the thread is running.
Definition state.hpp:140
std::mutex m_threadMutex
Synchronization primitive to guard start/stop operations.
Definition state.hpp:143
bool running() const
Returns whether a frame listening thread is currently active.
Definition state.cpp:8