9#if defined(_WIN32) || defined(__WINDOWS__) || defined(__WIN32__)
10#define WIN32_LEAN_AND_MEAN
12namespace moodycamel {
namespace debug {
14 DebugMutex() { InitializeCriticalSectionAndSpinCount(&cs, 0x400); }
15 ~DebugMutex() { DeleteCriticalSection(&cs); }
17 void lock() { EnterCriticalSection(&cs); }
18 void unlock() { LeaveCriticalSection(&cs); }
26namespace moodycamel {
namespace debug {
28 void lock() { m.lock(); }
29 void unlock() { m.unlock(); }
38namespace moodycamel {
namespace debug {
40 explicit DebugLock(DebugMutex& mutex)
57 struct DebugFreeList {
58 DebugFreeList() : head(nullptr) { }
59 DebugFreeList(DebugFreeList&& other) : head(other.head) { other.head =
nullptr; }
60 void swap(DebugFreeList& other) { std::swap(head, other.head); }
62 inline void add(N* node)
64 DebugLock lock(mutex);
65 node->freeListNext = head;
71 DebugLock lock(mutex);
72 if (head ==
nullptr) {
77 head = head->freeListNext;
81 N* head_unsafe()
const {
return head; }
Definition concurrentqueue_internal_debug.h:27