ReentrantSemaphore.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
How to respond to a semaphore request by a caller that has already entered the semaphore.