11#if ALIB_DEBUG_CRITICAL_SECTIONS
34#if ALIB_CAMP && !DOXYGEN
36"Assertion in Critical Section {!Q}" "\n"
38" In (Member-)Function: {2:ya}" "\n"
40" Is Shared Owned: {9}" "\n"
42" Called By: {3:ya}" "\n"
46" Latest Acquisition By: {4:ya}" "\n"
49" Latest Release By: {5:ya}" "\n"
53" Latest Shared Acquisition By: {7:ya}" "\n"
56" Latest SharedRelease By: {8:ya}" "\n"
63 const char* headline )
const
69 msg <<
"Assertion in Critical Section " <<
DCSName <<
"\n"
70 " Message: " << headline <<
"\n"
71 " Caller: " << ci <<
"\n"
74 " Latest Acquirement: " <<
DCSAcq <<
"\n"
75 " Latest Release: " <<
DCSRel <<
"\n\n"
76 " Latest Shared Acquirement: " <<
DCSSAcq <<
"\n"
77 " Latest Shared Release: " <<
DCSSRel <<
"\n\n"
78 "Note: Include ALib module BaseCamp in the ALib-Distribution to get nicer assertion output.\n";
135 "AcquireShared: Associated lock not shared-acquired." );
140 "AcquireShared: Acquired by different thread.");
149 "ReleaseShared: Associated lock not shared-acquired." );
152 "ReleaseShared: Internal error. Acquired by different thread while shared release.");
static ALIB_API textlogger::TextLogger * DebugLogger
The debug logger created by AddDebugLogger.
FormatMultiLine & GetFormatMultiLine()
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
ALIB_API void DbgSimpleALibMsg(const CallerInfo &ci, int type, const char *topic, const char *msg1=nullptr, const char *msg2=nullptr, const char *msg3=nullptr, const char *msg4=nullptr, const char *msg5=nullptr)
std::thread::id ThreadID
The ID of the calling thread.
virtual bool DCSIsSharedAcquired() const =0
virtual bool DCSIsAcquired() const =0
static ALIB_API const char * ASSERTION_FORMAT
ALIB_API void doAssert(bool cond, const CallerInfo &ciAssert, const CallerInfo &ci, const char *headline) const
std::atomic< int > DCSReaderCnt
Tracks enter/exit calls of readers.
CallerInfo DCSAcq
Source location of acquirement.
ALIB_API void ReleaseShared(const CallerInfo &ci) const
CallerInfo DCSRel
Source location of the last "reader" seen.
ALIB_API void Release(const CallerInfo &ci) const
CallerInfo DCSSAcq
Source location of acquirement.
CallerInfo DCSSRel
Source location of the last "reader" seen.
const char * DCSName
The name of this DCS. Used for debug-output.
ALIB_API void AcquireShared(const CallerInfo &ci) const
ALIB_FORCE_INLINE void yieldOrSleep() const
ALIB_API void Acquire(const CallerInfo &ci) const
std::atomic< int > DCSWriterCnt
Tracks enter/exit calls (including readers)