| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Copyright (c) 2008-2023 the Urho3D project
- // License: MIT
- #pragma once
- #ifdef URHO3D_IS_BUILDING
- #include "Urho3D.h"
- #else
- #include <Urho3D/Urho3D.h>
- #endif
- namespace Urho3D
- {
- /// %Condition on which a thread can wait.
- class URHO3D_API Condition
- {
- public:
- /// Construct.
- Condition();
- /// Destruct.
- ~Condition();
- /// Set the condition. Will be automatically reset once a waiting thread wakes up.
- void Set();
- /// Wait on the condition.
- void Wait();
- private:
- #ifndef _WIN32
- /// Mutex for the event, necessary for pthreads-based implementation.
- void* mutex_;
- #endif
- /// Operating system specific event.
- void* event_;
- };
- }
|