|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
Semantic placeholder for mutex_like types.
More...
#include <jh/typing/null_mutex.h>
Static Public Member Functions | |
| static bool | try_lock () noexcept |
| static bool | try_lock_shared () noexcept |
Semantic placeholder for mutex_like types.
A zero-cost, fully concept-compatible dummy mutex. All locking functions are implemented as no-ops, and all try_* operations always return true.
This type serves as a semantic stand-in for real synchronization primitives in contexts where locking is structurally required but semantically unnecessary — for example, when thread safety is guaranteed by design or when the data is confined to a single thread.
Concept compatibility:
jh::concepts::mutex_like jh::concepts::timed_mutex_like jh::concepts::rw_mutex_like jh::concepts::reentrance_capable_mutex It is analogous in spirit to std::nullptr_t: the type exists for semantic consistency, but creating distinct instances is meaningless. Use the provided global constant jh::typed::null_mutex instead.