다음을 통해 공유


SemaphoreSlim 생성자

정의

SemaphoreSlim 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
SemaphoreSlim(Int32)

동시에 부여할 수 있는 요청의 SemaphoreSlim 초기 수를 지정하여 클래스의 새 인스턴스를 초기화합니다.

SemaphoreSlim(Int32, Int32)

동시에 부여할 수 있는 초기 및 최대 요청 수를 지정하여 클래스의 새 인스턴스 SemaphoreSlim 를 초기화합니다.

SemaphoreSlim(Int32)

Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs

동시에 부여할 수 있는 요청의 SemaphoreSlim 초기 수를 지정하여 클래스의 새 인스턴스를 초기화합니다.

public:
 SemaphoreSlim(int initialCount);
public SemaphoreSlim(int initialCount);
new System.Threading.SemaphoreSlim : int -> System.Threading.SemaphoreSlim
Public Sub New (initialCount As Integer)

매개 변수

initialCount
Int32

동시에 부여할 수 있는 세마포에 대한 초기 요청 수입니다.

예외

initialCount 가 0보다 작습니다.

설명

매개 변수는 initialCount 부여할 수 있는 세마포를 입력하기 위한 동시 요청 수를 정의합니다. 그러나 동시에 부여할 수 있는 최대 요청 수는 정의하지 않습니다. SemaphoreSlim 이 생성자를 호출하여 인스턴스화된 개체는 메서드를 호출 Release 하면 속성 initialCount값이 증가하는 경우 예외를 CurrentCount throw SemaphoreFullException 하지 않습니다. 메서드에 대한 호출 Release 이 메서드 또는 WaitAsync 메서드보다 Wait 더 많은 경우 발생합니다. 부여할 수 있는 세마포를 입력하기 위한 최대 동시 요청 수를 설정하려면 생성자를 호출 SemaphoreSlim(Int32, Int32) 합니다.

추가 정보

적용 대상

SemaphoreSlim(Int32, Int32)

Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs

동시에 부여할 수 있는 초기 및 최대 요청 수를 지정하여 클래스의 새 인스턴스 SemaphoreSlim 를 초기화합니다.

public:
 SemaphoreSlim(int initialCount, int maxCount);
public SemaphoreSlim(int initialCount, int maxCount);
new System.Threading.SemaphoreSlim : int * int -> System.Threading.SemaphoreSlim
Public Sub New (initialCount As Integer, maxCount As Integer)

매개 변수

initialCount
Int32

동시에 부여할 수 있는 세마포에 대한 초기 요청 수입니다.

maxCount
Int32

동시에 부여할 수 있는 세마포에 대한 최대 요청 수입니다.

예외

initialCount 가 0보다 작거나 initialCount 0보다 maxCount크거나 maxCount 0보다 작거나 같습니다.

추가 정보

적용 대상