2#if ALIB_DEBUG_CRITICAL_SECTIONS
9"Assertion in Critical Section \"{}\"" "\n"
11" In (Member-)Function: {}" "\n"
12" Is Owned: {} ({})" "\n"
13" Is Shared Owned: {} ({})" "\n"
15" Called By: {}::{}" "\n"
19" Latest Acquisition By: {}::{}" "\n"
22" Latest Release By: {}::{}" "\n"
26" Latest Shared Acquisition By: {}::{}" "\n"
29" Latest SharedRelease By: {}::{}" "\n"
35 const char* headline )
const {
52 ||
DCSAcq.ThreadID == std::this_thread::get_id(),
ALIB_CALLER, ci,
"Acquired by other thread.");
70 "AcquireShared: Associated lock not shared-acquired." );
75 "AcquireShared: Acquired by different thread.");
83 "ReleaseShared: Associated lock not shared-acquired." );
86 "ReleaseShared: Internal error. Acquired by different thread while shared release.");
void Raise(const lang::CallerInfo &ci, int type, std::string_view domain, TArgs &&... args)
unsigned DBG_CRITICAL_SECTION_YIELD_OR_SLEEP_TIME_IN_NS
const char * File
The name of the source file as given by compiler.
const std::type_info * TypeInfo
The calling type.
int Line
The line number within #".File".
std::thread::id ThreadID
The ID of the calling thread.
CallerInfo DCSSRel
Source location of the last "reader" seen.
void yieldOrSleep() const
void Acquire(const CallerInfo &ci) const
void doAssert(bool cond, const CallerInfo &ciAssert, const CallerInfo &ci, const char *headline) const
CallerInfo DCSRel
Source location of the last "reader" seen.
const char * DCSName
The name of this DCS. Used for debug-output.
static const char * ASSERTION_FORMAT
CallerInfo DCSSAcq
Source location of acquirement.
CallerInfo DCSAcq
Source location of acquirement.
void Release(const CallerInfo &ci) const
void AcquireShared(const CallerInfo &ci) const
std::atomic< int > DCSReaderCnt
Tracks enter/exit calls of readers.
void ReleaseShared(const CallerInfo &ci) const
std::atomic< int > DCSWriterCnt
Tracks enter/exit calls (including readers).