12345678910111213141516171819202122232425 |
- #pragma once
- #include <thread>
- #include <mutex>
- #include <chrono>
- #include <condition_variable>
- class StdCondition
- {
- public:
- StdCondition();
- StdCondition(bool init);
- ~StdCondition();
- void Wait();
- bool WaitFor(unsigned int millisecond);
- void Notify(bool istrue);
- protected:
- static bool isTrue(StdCondition* scd);
- protected:
- bool m_value;
- std::mutex m_mutex;
- std::condition_variable m_cv;
- };
|