8#if !ALIB_SINGLE_THREADED && ALIB_DEBUG
23 const char*
Name =
"<unnamed>";
73 Ticks::Duration
WaitTimeLimit = Ticks::Duration::FromAbsoluteSeconds(2);
123 const char* headline );
131 DoAssert( 0, assertCI, ci,
"Not acquired" );
140 DoAssert( 0, assertCI, requestCI,
"Already (still) owned." );
157 DoAssert( 0, assertCI, requestCI,
"Release without having ownership");
169 DoAssert( 0, assertCI, ci, headline);
249 const char* headline )
override;
267 DoAssert( 0, assertCI, requestCI,
"Already (still) owned." );
269 DoAssert( 0, assertCI, requestCI,
"Already (still) shared-owned." );
283 DoAssert( 0, assertCI, requestCI,
"Already (still) owned." );
287 "Too many parallel shared acquisitions detected. "
288 "A reason might be that shared acquirers do not call ReleaseShared" );
298 if ( prevCounter <= 0 )
300 "Too many invocations of ReleaseShared (from any thread) without prior acquisition" );
373 const char* headline );
static Thread * GetCurrent()
lang::CallerInfo CallerInfo
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
std::thread::id ThreadID
The ID of the calling thread.
std::thread::id AssertExclusiveWaiter
bool IsOwnedByCurrentThread() const
ALIB_DLL void Assert(bool cond, const CallerInfo &assertCI, const CallerInfo &ci, const char *headline)
CallerInfo NotifyCI
The most recent call to ReleaseAndNotify or.
const character * Name
The name of this instance.
static ALIB_DLL const char * ASSERTION_FORMAT
CallerInfo RelCI
Source location of the most recent release.
Thread * Owner
Tracks the current owner.
std::atomic< int > CntWaiters
The number of currently waiting threads.
CallerInfo AcqCI
Source location of the most recent acquirement.
CallerInfo WaitCI
The most recent call to WaitForNotification.
void AssertOwned(const CallerInfo &assertCI, const CallerInfo &ci)
static ALIB_DLL const char * ASSERTION_FORMAT
bool IsOwnedByCurrentThread() const
CallerInfo RelCI
Source location of the most recent release.
virtual ALIB_DLL void DoAssert(int type, const CallerInfo &assertCI, const CallerInfo &ci, const char *headline)
ALIB_DLL Thread * GetOwner() const
void AssertNotOwning(const CallerInfo &assertCI, const CallerInfo &ci, const char *headline)
std::atomic< int > CntAcquirements
The number of shared acquirements.
bool WillRelease() const noexcept
ALIB_DLL void SetRecursiveOwner(const CallerInfo &assertCI, const CallerInfo &requestCI)
CallerInfo AcqCI
Source location of the most recent acquirement.
virtual ~DbgLockAsserter()
Destructor.
void Release(const CallerInfo &assertCI, const CallerInfo &requestCI)
void SetOwner(const CallerInfo &assertCI, const CallerInfo &requestCI)
Ticks::Duration WaitTimeLimit
bool IsSharedOwnedByAnyThread() const
CallerInfo SAcqCI
The most recent shared acquirement's caller.
virtual ~DbgSharedLockAsserter() override
Destructor.
ALIB_DLL void DoAssert(int type, const CallerInfo &assertCI, const CallerInfo &ci, const char *headline) override
void SetOwner(const CallerInfo &assertCI, const CallerInfo &requestCI)
static ALIB_DLL const char * ASSERTION_FORMAT_SHARED
void SetSharedOwner(const CallerInfo &assertCI, const CallerInfo &requestCI, int warnLimit)
std::atomic< int > CntSharedAcquirements
The number of shared acquirements.
void ReleaseShared(const CallerInfo &assertCI, const CallerInfo &requestCI)
CallerInfo SRelCI
The most recent shared release caller.