From b391ebabbe8e92c19ad5b7c5ec7fa0a10aabb8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 27 Jan 2017 22:50:57 +0100 Subject: [PATCH] Add more specific assertion for SpinLock initialization. --- source/vibe/core/sync.d | 1 + 1 file changed, 1 insertion(+) diff --git a/source/vibe/core/sync.d b/source/vibe/core/sync.d index aaec4f1..faa09a0 100644 --- a/source/vibe/core/sync.d +++ b/source/vibe/core/sync.d @@ -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); }