ReentrantSemaphore.Create Method

Definition

Initializes a new instance of the ReentrantSemaphore class.

public static Microsoft.VisualStudio.Threading.ReentrantSemaphore Create (int initialCount = 1, Microsoft.VisualStudio.Threading.JoinableTaskContext joinableTaskContext = default, Microsoft.VisualStudio.Threading.ReentrantSemaphore.ReentrancyMode mode = Microsoft.VisualStudio.Threading.ReentrantSemaphore+ReentrancyMode.NotAllowed);
public static Microsoft.VisualStudio.Threading.ReentrantSemaphore Create (int initialCount = 1, Microsoft.VisualStudio.Threading.JoinableTaskContext? joinableTaskContext = default, Microsoft.VisualStudio.Threading.ReentrantSemaphore.ReentrancyMode mode = Microsoft.VisualStudio.Threading.ReentrantSemaphore+ReentrancyMode.NotAllowed);
static member Create : int * Microsoft.VisualStudio.Threading.JoinableTaskContext * Microsoft.VisualStudio.Threading.ReentrantSemaphore.ReentrancyMode -> Microsoft.VisualStudio.Threading.ReentrantSemaphore
Public Shared Function Create (Optional initialCount As Integer = 1, Optional joinableTaskContext As JoinableTaskContext = Nothing, Optional mode As ReentrantSemaphore.ReentrancyMode = Microsoft.VisualStudio.Threading.ReentrantSemaphore+ReentrancyMode.NotAllowed) As ReentrantSemaphore

Parameters

initialCount
Int32

The initial number of concurrent operations to allow.

joinableTaskContext
JoinableTaskContext

The JoinableTaskContext to use to mitigate deadlocks.

mode
ReentrantSemaphore.ReentrancyMode

How to respond to a semaphore request by a caller that has already entered the semaphore.

Returns

Applies to