DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::Threading Namespace Reference

Namespaces

namespace  Tasks

Classes

class  AbandonedMutexException
 Exception thrown when a thread acquires a Mutex object that another thread has abandoned by exiting without releasing it. More...
class  AutoResetEvent
 Notifies a waiting thread that an event has occurred. More...
class  ConditionVariable
 Provides a synchronization primitive that can be used to block a thread, or multiple threads, until another thread modifies a shared variable and notifies the ConditionVariable. More...
class  CriticalSection
 Provides a re-entrant mutual exclusion primitive for thread synchronization. More...
class  EventWaitHandle
 Represents a thread synchronization event. More...
class  Interlocked
 Provides atomic operations for variables that are shared by multiple threads. More...
class  InterlockedInternal
 Internal helper exposing platform-specific atomic intrinsic primitives. More...
class  Lock
 Provides an RAII-style scoped lock wrapper around synchronization primitives. More...
class  Lock< CriticalSection >
 Specialization of Lock for CriticalSection objects. More...
class  LockWaitHandle
 Abstract base class for wait handles that support releasing acquire counts. More...
class  ManualResetEvent
 Notifies one or more waiting threads that an event has occurred. More...
class  Mutex
 A synchronization primitive that can also be used for interprocess synchronization. More...
class  Semaphore
 Limits the number of threads that can access a resource or pool of resources concurrently. More...
class  SemaphoreFullException
 Exception thrown when the Semaphore::Release method is called on a semaphore whose count is already at the maximum. More...
class  SemaphoreSlim
 Represents a lightweight alternative to Semaphore that limits the number of threads that can access a resource or pool of resources concurrently. More...
class  SynchronizationLockException
 Exception thrown when a method requires synchronization on a Monitor/lock, but the caller does not own the lock. More...
class  Thread
 Creates and controls execution of operating system threads. More...
class  ThreadInterruptedException
 Exception thrown when a thread is interrupted while it is in a waiting state. More...
class  ThreadPool
 Provides a pool of threads that can be used to execute tasks, post work items, and process timers. More...
class  ThreadStateException
 Exception thrown when a thread is in an invalid ThreadState for the requested operation. More...
class  WaitHandle
 Encapsulates operating system-specific objects that wait for exclusive access to shared resources. More...
class  WaitHandleCannotBeOpenedException
 Exception thrown when an attempt to open a system synchronization handle that does not exist fails. More...

Typedefs

typedef Lock< CriticalSectionCriticalSectionLock
 Convenience alias for Lock<CriticalSection>.
typedef Lock< MutexMutexLock
 Convenience alias for Lock<Mutex>.
typedef Action< Object * > ParameterizedThreadStart
typedef Lock< SemaphoreSemaphoreLock
 Convenience alias for Lock<Semaphore>.
typedef Lock< SemaphoreSlimSemaphoreSlimLock
 Convenience alias for Lock<SemaphoreSlim>.
typedef Action ThreadStart
typedef Action< Object * > WaitCallback
 Represents a callback method to be executed by a thread pool thread.

Functions

static HANDLE OpenOrCreateWin32Event (const std::wstring &wsName, bool manualReset, bool initialState, bool openAlways, bool &bCreatedNew)
static HANDLE OpenOrCreateWin32Mutex (const std::wstring &wsName, bool bInitiallyOwned, bool openAlways, bool &bCreatedNew)
static HANDLE OpenOrCreateWin32Semaphore (const std::wstring &wsName, int initialCount, int maximumCount, bool openAlways, bool &bCreatedNew)
static int ReleaseSemaphoreCv (Semaphore::Impl *pImpl, int &count, int maxCount, int releaseCount)
static void SafelyJoinOrDetach (const std::unique_ptr< std::thread > &pThread)
static bool WaitForEventCv (EventWaitHandle::Impl *pImpl, bool &bState, bool bManualReset)
static bool WaitForEventCv (EventWaitHandle::Impl *pImpl, bool &bState, bool bManualReset, int msTimeout)
static bool WaitForSemaphoreCv (Semaphore::Impl *pImpl, int &count, int msTimeout)

Variables

static bool s_autoDummyCreatedNew = false
static bool s_dummyCreatedNew = false
static bool s_manualDummyCreatedNew = false
static bool s_mutexDummyCreatedNew = false
static SmartPointer< Threads_pCurrentThreadStorage (nullptr)
static bool s_semDummyCreatedNew = false

Typedef Documentation

◆ CriticalSectionLock

Convenience alias for Lock<CriticalSection>.

Definition at line 71 of file Lock.h.

◆ MutexLock

Convenience alias for Lock<Mutex>.

Definition at line 75 of file Lock.h.

◆ ParameterizedThreadStart

◆ SemaphoreLock

Convenience alias for Lock<Semaphore>.

Definition at line 79 of file Lock.h.

◆ SemaphoreSlimLock

Convenience alias for Lock<SemaphoreSlim>.

Definition at line 83 of file Lock.h.

◆ ThreadStart

Definition at line 16 of file Thread.h.

◆ WaitCallback

Represents a callback method to be executed by a thread pool thread.

Definition at line 16 of file ThreadPool.h.

Function Documentation

◆ OpenOrCreateWin32Event()

HANDLE DotNetDupe::System::Threading::OpenOrCreateWin32Event ( const std::wstring & wsName,
bool manualReset,
bool initialState,
bool openAlways,
bool & bCreatedNew )
static

◆ OpenOrCreateWin32Mutex()

HANDLE DotNetDupe::System::Threading::OpenOrCreateWin32Mutex ( const std::wstring & wsName,
bool bInitiallyOwned,
bool openAlways,
bool & bCreatedNew )
static

◆ OpenOrCreateWin32Semaphore()

HANDLE DotNetDupe::System::Threading::OpenOrCreateWin32Semaphore ( const std::wstring & wsName,
int initialCount,
int maximumCount,
bool openAlways,
bool & bCreatedNew )
static

◆ ReleaseSemaphoreCv()

int DotNetDupe::System::Threading::ReleaseSemaphoreCv ( Semaphore::Impl * pImpl,
int & count,
int maxCount,
int releaseCount )
static

◆ SafelyJoinOrDetach()

void DotNetDupe::System::Threading::SafelyJoinOrDetach ( const std::unique_ptr< std::thread > & pThread)
static

Guard: Verify thread exists and is joinable.

Safely detach if current thread is tearing down itself, otherwise join.

Definition at line 53 of file Thread.cpp.

References SafelyJoinOrDetach().

Referenced by DotNetDupe::System::Threading::Thread::~Thread(), and SafelyJoinOrDetach().

◆ WaitForEventCv() [1/2]

bool DotNetDupe::System::Threading::WaitForEventCv ( EventWaitHandle::Impl * pImpl,
bool & bState,
bool bManualReset )
static

◆ WaitForEventCv() [2/2]

bool DotNetDupe::System::Threading::WaitForEventCv ( EventWaitHandle::Impl * pImpl,
bool & bState,
bool bManualReset,
int msTimeout )
static

Timed wait for condition variable signal.

Definition at line 162 of file EventWaitHandle.cpp.

References DotNetDupe::System::TimeoutException::TimeoutException(), and WaitForEventCv().

◆ WaitForSemaphoreCv()

bool DotNetDupe::System::Threading::WaitForSemaphoreCv ( Semaphore::Impl * pImpl,
int & count,
int msTimeout )
static

Condition variable timed wait helper.

Definition at line 139 of file Semaphore.cpp.

References DotNetDupe::System::TimeoutException::TimeoutException(), and WaitForSemaphoreCv().

Referenced by WaitForSemaphoreCv(), and DotNetDupe::System::Threading::Semaphore::WaitOne().

Variable Documentation

◆ s_autoDummyCreatedNew

bool DotNetDupe::System::Threading::s_autoDummyCreatedNew = false
static

◆ s_dummyCreatedNew

bool DotNetDupe::System::Threading::s_dummyCreatedNew = false
static

◆ s_manualDummyCreatedNew

bool DotNetDupe::System::Threading::s_manualDummyCreatedNew = false
static

◆ s_mutexDummyCreatedNew

bool DotNetDupe::System::Threading::s_mutexDummyCreatedNew = false
static

◆ s_pCurrentThreadStorage

SmartPointer< Thread > DotNetDupe::System::Threading::s_pCurrentThreadStorage(nullptr) ( nullptr )
thread_localstatic

◆ s_semDummyCreatedNew

bool DotNetDupe::System::Threading::s_semDummyCreatedNew = false
static