Add more specific assertion for SpinLock initialization.

This commit is contained in:
Sönke Ludwig 2017-01-27 22:50:57 +01:00
parent fc96ee9050
commit b391ebabbe
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -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);
}