Add more specific assertion for SpinLock initialization.
This commit is contained in:
parent
fc96ee9050
commit
b391ebabbe
1 changed files with 1 additions and 0 deletions
|
@ -1023,6 +1023,7 @@ package struct SpinLock {
|
|||
|
||||
bool tryLock()
|
||||
@trusted {
|
||||
assert(threadID != 0, "SpinLock.setup() was not called.");
|
||||
assert(atomicLoad(locked) != threadID, "Recursive lock attempt.");
|
||||
return cas(&locked, 0, threadID);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue