1 #ifndef ossimThread_HEADER 2 #define ossimThread_HEADER 1 7 #include <condition_variable> 75 Interrupt(
const std::string& what=
""):m_what(what){}
76 virtual const char*
what()
const throw(){
return m_what.c_str();}
100 bool isRunning()
const{
return m_running.load(std::memory_order_relaxed);}
123 virtual void setCancel(
bool flag);
130 virtual void waitForCompletion();
146 bool isPaused()
const;
174 static std::thread::id getCurrentThreadId();
183 static void yieldCurrentThread();
190 virtual void run()=0;
196 virtual void interrupt();
206 virtual void runInternal();
219 void setInterruptable(
bool flag);
std::shared_ptr< ossim::Barrier > m_pauseBarrier
Interrupt(const std::string &what="")
std::shared_ptr< std::thread > m_thread
This code was derived from https://gist.github.com/mshockwave.
std::atomic< bool > m_interrupt
This is an Interrupt exception that is thrown if the.
Thread is an abstract class.
std::atomic< bool > m_running
unsigned long long ossim_uint64
std::mutex m_runningMutex
std::condition_variable m_runningCondition
virtual void cancel()
This basically requests that the thread be canceled.
virtual const char * what() const
bool isInterruptable() const
This is typically set if.