Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
AssertExternallySynchronizedMutex.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <forward_list>
#include <memory>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <thread>
#include "Stroika/Foundation/Common/Common.h"
#include "Stroika/Foundation/Debug/Assertions.h"
#include "Stroika/Foundation/Debug/Sanitizer.h"
#include "AssertExternallySynchronizedMutex.inl"

Go to the source code of this file.

Classes

class  Stroika::Foundation::Debug::AssertExternallySynchronizedMutex
 NOT a real mutex - just a debugging infrastructure support tool so in debug builds can be assured threadsafe, which is syntactically used like a mutex, for SIMILAR reasons in similar places. More...
 

Namespaces

namespace  Stroika::Foundation
 

Macros

#define qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled   0
 qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled controls if this threaded access protection
 

Detailed Description

Note
Code-Status: Release

TODO:

Since Stroika 2.1b10 we do have a lock/free forward_list class I could try. But I'm not yet confident in its stability, so maybe sometime down the road...

See also
http://stroika-bugs.sophists.com/browse/STK-540 for details on stuff todo above

Definition in file AssertExternallySynchronizedMutex.h.

Macro Definition Documentation

◆ qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled

#define qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled   0

qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled controls if this threaded access protection

The compilation compile-time macro qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled can be used
to control if AssertExternallySynchronizedMutex checking is enabled.

If its not defined (typical), we look at qStroika_Foundation_Debug_AssertionsChecked. If that is false, qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled is disabled.

If qStroika_Foundation_Debug_AssertionsChecked is true, BUT, we have TSAN enabled, we STILL (change in Stroika v3.0d1) - DISABLE kAssertExternallySynchronizedMutexEnabled
since its slow, and redundant.

Only if qStroika_Foundation_Debug_AssertionsChecked is true, there is no TSAN, and qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled is made
do we turn on qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled.
Note
TRIED to do this with constexpr bool kAssertExternallySynchronizedMutexEnabled, but as of C++20 rules still too much of a PITA to use: cannot conditionally define classes, and nearly anything based on requires/if constexpr, unless it is a template.

Definition at line 67 of file AssertExternallySynchronizedMutex.h.