共用方式為


ReentrantSemaphore.SuppressRelevance Method

Definition

Conceals evidence that the caller has entered this ReentrantSemaphore till its result is disposed.

public:
 virtual Microsoft::VisualStudio::Threading::ReentrantSemaphore::RevertRelevance SuppressRelevance();
public virtual Microsoft.VisualStudio.Threading.ReentrantSemaphore.RevertRelevance SuppressRelevance ();
abstract member SuppressRelevance : unit -> Microsoft.VisualStudio.Threading.ReentrantSemaphore.RevertRelevance
override this.SuppressRelevance : unit -> Microsoft.VisualStudio.Threading.ReentrantSemaphore.RevertRelevance
Public Overridable Function SuppressRelevance () As ReentrantSemaphore.RevertRelevance

Returns

A value to dispose to restore visibility of any presence in this semaphore.

Remarks

This method is useful when the caller is about to spin off another operation (e.g. scheduling work to the threadpool) that it does not consider vital to its own completion, in order to prevent the spun off work from abusing the caller's right to the semaphore.

This is a safe call to make whether or not the semaphore is currently held, or whether reentrancy is allowed on this instance.

Applies to