DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
SemaphoreSlim.h
Go to the documentation of this file.
1
5
6#pragma once
7#include "Common.h"
9
10namespace DotNetDupe {
11 namespace System {
12 namespace Threading {
19 public:
22 DOTNETDUPE_API SemaphoreSlim(int initialCount);
23
27 DOTNETDUPE_API SemaphoreSlim(int initialCount, int maximumCount);
28
31
34 DOTNETDUPE_API bool WaitOne() override;
35
40 DOTNETDUPE_API bool WaitOne(int millisecondsTimeout) override;
41
46 DOTNETDUPE_API int Release(int releaseCount = 1) override;
47
51
52 struct Impl;
53 private:
54 int _count;
55 int _maxCount;
56 Impl* _pImpl;
57 };
58 }
59 }
60}
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
Base abstract classes for synchronization wait handles.
Abstract base class for wait handles that support releasing acquire counts.
Definition WaitHandle.h:35
bool WaitOne() override
Blocks the current thread until it can enter the SemaphoreSlim.
SemaphoreSlim(int initialCount)
Initializes a new instance of the SemaphoreSlim class, specifying the initial number of requests that...
int Release(int releaseCount=1) override
Releases the SemaphoreSlim object a specified number of times.
int GetCurrentCount() const
Gets the number of remaining threads that can enter the SemaphoreSlim object.