SpinLock.Exit SpinLock.Exit SpinLock.Exit SpinLock.Exit Method

Definition

Releases the lock.

Overloads

Exit() Exit() Exit() Exit()

Releases the lock.

Exit(Boolean) Exit(Boolean) Exit(Boolean) Exit(Boolean)

Releases the lock.

Exit() Exit() Exit() Exit()

Releases the lock.

public:
 void Exit();
public void Exit ();
member this.Exit : unit -> unit
Public Sub Exit ()

Exceptions

Thread ownership tracking is enabled, and the current thread is not the owner of this lock.

Remarks

The default overload of Exit provides the same behavior as if calling Exit using true as the argument.

If you call Exit without having first called Enter the internal state of the SpinLock can become corrupted.

See also

Exit(Boolean) Exit(Boolean) Exit(Boolean) Exit(Boolean)

Releases the lock.

public:
 void Exit(bool useMemoryBarrier);
public void Exit (bool useMemoryBarrier);
member this.Exit : bool -> unit
Public Sub Exit (useMemoryBarrier As Boolean)

Parameters

useMemoryBarrier
Boolean Boolean Boolean Boolean

A Boolean value that indicates whether a memory fence should be issued in order to immediately publish the exit operation to other threads.

Exceptions

Thread ownership tracking is enabled, and the current thread is not the owner of this lock.

Remarks

Calling Exit with the useMemoryBarrier argument set to true will improve the fairness of the lock at the expense of some performance. The default Exit overload behaves as if specifying true for useMemoryBarrier.

If you call Exit without having first called Enter the internal state of the SpinLock can become corrupted.

See also

Applies to