MCPcopy Create free account
hub / github.com/cameron314/readerwriterqueue / ReentrantGuard

Class ReentrantGuard

readerwriterqueue.h:676–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674private:
675#ifndef NDEBUG
676 struct ReentrantGuard
677 {
678 AE_NO_TSAN ReentrantGuard(weak_atomic<bool>& _inSection)
679 : inSection(_inSection)
680 {
681 assert(!inSection && "Concurrent (or re-entrant) enqueue or dequeue operation detected (only one thread at a time may hold the producer or consumer role)");
682 inSection = true;
683 }
684
685 AE_NO_TSAN ~ReentrantGuard() { inSection = false; }
686
687 private:
688 ReentrantGuard& operator=(ReentrantGuard const&);
689
690 private:
691 weak_atomic<bool>& inSection;
692 };
693#endif
694
695 struct Block

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected