9#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
10# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
25#if ALIB_DEBUG_CRITICAL_SECTIONS
32"Assertion in Critical Section \"{}\"" "\n"
34" In (Member-)Function: {}" "\n"
35" Is Owned: {} ({})" "\n"
36" Is Shared Owned: {} ({})" "\n"
38" Called By: {}::{}" "\n"
42" Latest Acquisition By: {}::{}" "\n"
45" Latest Release By: {}::{}" "\n"
49" Latest Shared Acquisition By: {}::{}" "\n"
52" Latest SharedRelease By: {}::{}" "\n"
58 const char* headline )
const
77 ||
DCSAcq.ThreadID == std::this_thread::get_id(),
ALIB_CALLER, ci,
"Acquired by other thread.");
97 "AcquireShared: Associated lock not shared-acquired." );
102 "AcquireShared: Acquired by different thread.");
111 "ReleaseShared: Associated lock not shared-acquired." );
114 "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 int 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
ALIB_DLL void Acquire(const CallerInfo &ci) const
ALIB_DLL 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 ALIB_DLL const char * ASSERTION_FORMAT
CallerInfo DCSSAcq
Source location of acquirement.
CallerInfo DCSAcq
Source location of acquirement.
ALIB_DLL void Release(const CallerInfo &ci) const
ALIB_DLL void AcquireShared(const CallerInfo &ci) const
std::atomic< int > DCSReaderCnt
Tracks enter/exit calls of readers.
ALIB_DLL void ReleaseShared(const CallerInfo &ci) const
std::atomic< int > DCSWriterCnt
Tracks enter/exit calls (including readers)