RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::Threading::Semaphore Class Reference

限制可同时访问某一资源或资源池的线程数 More...

Inheritance diagram for System::Threading::Semaphore:
System::Threading::WaitHandle

Public Member Functions

 Semaphore (ULONG nInitialCount, ULONG nMaximumCount, const String &szName=Nothing)
 初始化 Semaphore 类的新实例,并指定最大并发入口数,还可以选择为调用线程保留某些入口,以及选择指定系统信号量对象的名称 More...
 
ULONG Release (ULONG releaseCount=1)
 以指定的次数退出信号量并返回前一个计数 More...
 
- Public Member Functions inherited from System::Threading::WaitHandle
WaitStatus WaitOne (DWORD millisecondsTimeout=INFINITE)
 If a timeout is specified, and the object has not attained a state of signaled when the timeout expires, then the wait is automatically satisfied. An INFINITE timeout will never expire. If an explicit timeout value of zero is specified, then no wait occurs if the wait cannot be satisfied immediately. More...
 

Static Public Member Functions

static SemaphoreOpenExisting (const String &)
 如果它已经存在,打开指定的命名 Mutex More...
 
- Static Public Member Functions inherited from System::Threading::WaitHandle
static WaitStatus Wait (ULONG nCount, HANDLE *pHandles, bool bWaitAll, bool bAlertable, DWORD millisecondsTimeout)
 等待指定数组中的任一或者全部元素收到信号,使用 32 位带符号整数指定时间间隔 More...
 
static WaitStatus WaitOne (HANDLE handle, bool bAlertable, DWORD millisecondsTimeout)
 阻止当前线程,直到当前收到信号,同时使用 32 位带符号整数指定时间间隔 More...
 

Public Attributes

 RLIB_DECLARE_DYNCREATE
 
- Public Attributes inherited from System::Threading::WaitHandle
HANDLE Handle
 Gets the native operating system handle More...
 

Additional Inherited Members

- Protected Attributes inherited from System::Threading::WaitHandle
RLIB_OBJECT_ATTRIBUTES m_obj
 
RLIB_UNICODE_STRING m_name
 

Detailed Description

限制可同时访问某一资源或资源池的线程数

Constructor & Destructor Documentation

Semaphore::Semaphore ( ULONG  nInitialCount,
ULONG  nMaximumCount,
const String szName = Nothing 
)

初始化 Semaphore 类的新实例,并指定最大并发入口数,还可以选择为调用线程保留某些入口,以及选择指定系统信号量对象的名称

Member Function Documentation

Semaphore * Semaphore::OpenExisting ( const String szName)
static

如果它已经存在,打开指定的命名 Mutex

ULONG Semaphore::Release ( ULONG  releaseCount = 1)

以指定的次数退出信号量并返回前一个计数


The documentation for this class was generated from the following files: