DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
EventWaitHandle.h
Go to the documentation of this file.
1
5
6#pragma once
7#include "Common.h"
10#include "System/String.h"
11
12namespace DotNetDupe {
13 namespace System {
14 namespace Threading {
21 class EventWaitHandle : public WaitHandle {
22 public:
26 DOTNETDUPE_API EventWaitHandle(bool initialState, bool manualReset);
27
33 DOTNETDUPE_API EventWaitHandle(const String& sName, bool initialState = false, bool manualReset = false, bool openAlways = true);
34
40 DOTNETDUPE_API EventWaitHandle(bool initialState, bool manualReset, const String& sName, bool openAlways = true);
41
48 DOTNETDUPE_API EventWaitHandle(bool initialState, bool manualReset, const String& sName, bool openAlways, bool& bCreatedNew);
49
52
55 DOTNETDUPE_API bool Set();
56
59 DOTNETDUPE_API bool Reset();
60
63 DOTNETDUPE_API bool WaitOne() override;
64
68 DOTNETDUPE_API bool WaitOne(int millisecondsTimeout) override;
69
75
80 DOTNETDUPE_API static bool TryOpenExisting(const String& sName, SmartPointer<EventWaitHandle>& pResult);
81
82 struct Impl;
83 protected:
84 bool _state;
87 void* _hHandle;
88 Impl* _pImpl;
89 };
90 }
91 }
92}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Base abstract classes for synchronization wait handles.
A unified smart pointer that supports both unique and shared ownership semantics.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
bool Set()
Sets the state of the event to signaled, allowing one or more waiting threads to proceed.
static SmartPointer< EventWaitHandle > OpenExisting(const String &sName)
Opens an existing named system event wait handle.
static bool TryOpenExisting(const String &sName, SmartPointer< EventWaitHandle > &pResult)
Opens an existing named system event wait handle, and returns a value that indicates whether the oper...
bool WaitOne() override
Blocks the current thread until the current WaitHandle receives a signal.
bool Reset()
Sets the state of the event to nonsignaled, causing threads to block.
EventWaitHandle(bool initialState, bool manualReset)
Initializes a new instance of the EventWaitHandle class, specifying whether the wait handle is initia...
Encapsulates operating system-specific objects that wait for exclusive access to shared resources.
Definition WaitHandle.h:18