SpinLock.Exit 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.
Releases the lock.
Overloads
Exit() |
Releases the lock. |
Exit(Boolean) |
Releases the lock. |
Exit()
- Source:
- SpinLock.cs
- Source:
- SpinLock.cs
- Source:
- SpinLock.cs
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
- SpinLock
- How to: Use SpinLock for Low-Level Synchronization
- How to: Enable Thread-Tracking Mode in SpinLock
Applies to
Exit(Boolean)
- Source:
- SpinLock.cs
- Source:
- SpinLock.cs
- Source:
- SpinLock.cs
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
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
- SpinLock
- How to: Use SpinLock for Low-Level Synchronization
- How to: Enable Thread-Tracking Mode in SpinLock
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기