DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
Mutex.h
Go to the documentation of this file.
1
5
6
#pragma once
7
#include "
Common.h
"
8
#include "
System/Threading/WaitHandle.h
"
9
#include "
System/SmartPointer.h
"
10
#include "
System/String.h
"
11
12
namespace
DotNetDupe
{
13
namespace
System
{
14
namespace
Threading
{
21
class
Mutex
:
public
LockWaitHandle
{
22
public
:
24
DOTNETDUPE_API
Mutex
();
25
28
DOTNETDUPE_API
Mutex
(
bool
bInitiallyOwned);
29
34
DOTNETDUPE_API
Mutex
(
const
String
& sName,
bool
bInitiallyOwned =
false
,
bool
openAlways =
true
);
35
40
DOTNETDUPE_API
Mutex
(
bool
bInitiallyOwned,
const
String
& sName,
bool
openAlways =
true
);
41
47
DOTNETDUPE_API
Mutex
(
bool
bInitiallyOwned,
const
String
& sName,
bool
openAlways,
bool
& bCreatedNew);
48
50
DOTNETDUPE_API
~Mutex
()
override
;
51
54
DOTNETDUPE_API
bool
WaitOne
()
override
;
55
59
DOTNETDUPE_API
bool
WaitOne
(
int
millisecondsTimeout)
override
;
60
64
DOTNETDUPE_API
int
Release
(
int
releaseCount = 1)
override
;
65
70
DOTNETDUPE_API
static
SmartPointer<Mutex>
OpenExisting
(
const
String
& sName);
71
76
DOTNETDUPE_API
static
bool
TryOpenExisting
(
const
String
& sName,
SmartPointer<Mutex>
& pResult);
77
78
struct
Impl;
79
private
:
80
String
_name;
81
void
* _hHandle;
82
Impl* _pImpl;
83
};
84
}
85
}
86
}
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
SmartPointer.h
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
WaitHandle.h
Base abstract classes for synchronization wait handles.
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::Threading::LockWaitHandle
Abstract base class for wait handles that support releasing acquire counts.
Definition
WaitHandle.h:35
DotNetDupe::System::Threading::Mutex::OpenExisting
static SmartPointer< Mutex > OpenExisting(const String &sName)
Opens an existing named system mutex.
Definition
Mutex.cpp:103
DotNetDupe::System::Threading::Mutex::Mutex
Mutex()
Initializes a new instance of the Mutex class with default properties.
Definition
Mutex.cpp:24
DotNetDupe::System::Threading::Mutex::Release
int Release(int releaseCount=1) override
Releases the Mutex once.
Definition
Mutex.cpp:162
DotNetDupe::System::Threading::Mutex::TryOpenExisting
static bool TryOpenExisting(const String &sName, SmartPointer< Mutex > &pResult)
Opens an existing named system mutex, and returns a value that indicates whether the operation succee...
Definition
Mutex.cpp:112
DotNetDupe::System::Threading::Mutex::WaitOne
bool WaitOne() override
Blocks the current thread until the current WaitHandle receives a signal.
Definition
Mutex.cpp:133
DotNetDupe::System::Threading
Definition
AbandonedMutexException.h:11
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
Include
System
Threading
Mutex.h
Generated by
1.18.0