40 if (thread_.joinable())
58 virtual int svc() = 0;
62 if (thread_.joinable())
64 thread_ = std::thread([
this]() { (void)
svc(); });
77 if (thread_.joinable())
114 std::recursive_mutex mutex_;
139 if (lock_ !=
nullptr)
Base class for threads in MM devices.
Definition DeviceThreads.h:32
virtual ~MMDeviceThreadBase()
Definition DeviceThreads.h:36
void activate()
Definition DeviceThreads.h:60
void wait()
Definition DeviceThreads.h:72
MMDeviceThreadBase & operator=(const MMDeviceThreadBase &)=delete
MMDeviceThreadBase(const MMDeviceThreadBase &)=delete
virtual int svc()=0
This function is called on the new thread.
MMDeviceThreadBase & operator=(MMDeviceThreadBase &&)=delete
MMDeviceThreadBase(MMDeviceThreadBase &&)=delete
MMDeviceThreadBase()
Definition DeviceThreads.h:34
RAII object to acquire and auto-release MMThreadLock.
Definition DeviceThreads.h:124
MMThreadGuard(MMThreadGuard &&)=delete
MMThreadGuard(MMThreadLock *lock)
Definition DeviceThreads.h:131
MMThreadGuard & operator=(MMThreadGuard &&)=delete
MMThreadGuard(MMThreadLock &lock)
Definition DeviceThreads.h:126
MMThreadGuard(const MMThreadGuard &)=delete
MMThreadGuard & operator=(const MMThreadGuard &)=delete
~MMThreadGuard()
Definition DeviceThreads.h:137
Critical section lock.
Definition DeviceThreads.h:92
MMThreadLock(const MMThreadLock &)=delete
MMThreadLock & operator=(const MMThreadLock &)=delete
void Lock()
Definition DeviceThreads.h:103
MMThreadLock & operator=(MMThreadLock &&)=delete
void Unlock()
Definition DeviceThreads.h:108
MMThreadLock(MMThreadLock &&)=delete