DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
SemaphoreSlim.h
Go to the documentation of this file.
1
5
6
#pragma once
7
#include "
Common.h
"
8
#include "
System/Threading/WaitHandle.h
"
9
10
namespace
DotNetDupe
{
11
namespace
System
{
12
namespace
Threading
{
18
class
SemaphoreSlim
:
public
LockWaitHandle
{
19
public
:
22
DOTNETDUPE_API
SemaphoreSlim
(
int
initialCount);
23
27
DOTNETDUPE_API
SemaphoreSlim
(
int
initialCount,
int
maximumCount);
28
30
DOTNETDUPE_API
~SemaphoreSlim
()
override
;
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
50
DOTNETDUPE_API
int
GetCurrentCount
()
const
;
51
52
struct
Impl;
53
private
:
54
int
_count;
55
int
_maxCount;
56
Impl* _pImpl;
57
};
58
}
59
}
60
}
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
WaitHandle.h
Base abstract classes for synchronization wait handles.
DotNetDupe::System::Threading::LockWaitHandle
Abstract base class for wait handles that support releasing acquire counts.
Definition
WaitHandle.h:35
DotNetDupe::System::Threading::SemaphoreSlim::WaitOne
bool WaitOne() override
Blocks the current thread until it can enter the SemaphoreSlim.
Definition
SemaphoreSlim.cpp:33
DotNetDupe::System::Threading::SemaphoreSlim::SemaphoreSlim
SemaphoreSlim(int initialCount)
Initializes a new instance of the SemaphoreSlim class, specifying the initial number of requests that...
Definition
SemaphoreSlim.cpp:19
DotNetDupe::System::Threading::SemaphoreSlim::Release
int Release(int releaseCount=1) override
Releases the SemaphoreSlim object a specified number of times.
Definition
SemaphoreSlim.cpp:59
DotNetDupe::System::Threading::SemaphoreSlim::GetCurrentCount
int GetCurrentCount() const
Gets the number of remaining threads that can enter the SemaphoreSlim object.
Definition
SemaphoreSlim.cpp:74
DotNetDupe::System::Threading
Definition
AbandonedMutexException.h:11
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
Include
System
Threading
SemaphoreSlim.h
Generated by
1.18.0