After playing with thread in Windows, let's try another concurrency type--Event. It is an action that can be triggered by the system. To know further about it, let's take a look at the following code snippet where we create a new class named Event that implements UniqueHandle as well:
class Event { private: NullHandle hnd; public: Event(Event const &) = delete; auto operator=(Event const &)->Event & = delete; ~Event() = default; explicit Event(bool manual) : hnd { CreateEvent(nullptr, manual, false, nullptr) } { if (!hnd) throw WinException(); } explicit Event(EventType evType) : hnd { CreateEvent( nullptr, static_cast<BOOL>(evType), false, nullptr) } { if (!hnd) throw WinException(); } Event(Event && other) throw() : ...