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.
Loading...
Searching...
No Matches
mutex_like.h File Reference

Foundational synchronization concepts and reentrance traits. More...

#include <concepts>
#include <chrono>
#include <mutex>
#include <type_traits>

Go to the source code of this file.

Classes

struct  jh::recursive_registry< T >
 Trait registry for detecting counting reentrance (recursive). More...
struct  jh::reentrant_registry< T >
 Trait registry for detecting idempotent (structural) reentrance. More...
struct  jh::recursive_registry< std::recursive_mutex >
 Specialization for std::recursive_mutex. More...
struct  jh::recursive_registry< std::recursive_timed_mutex >
 Specialization for std::recursive_timed_mutex. More...

Namespaces

namespace  jh::concepts
 Behavioral concept namespace of the JH Toolkit.

Concepts

concept  jh::concepts::basic_lockable
 Concept for basic lockable objects.
concept  jh::concepts::excl_lockable
 Concept for exclusive lockable objects supporting try semantics.
concept  jh::concepts::timed_excl_lockable
 Concept for timed exclusive lockable objects.
concept  jh::concepts::shared_lockable
 Concept for shared (reader) lockable objects.
concept  jh::concepts::timed_shared_lockable
 Concept for shared lockables supporting timed acquisition.
concept  jh::concepts::mutex_like
 General mutex-like concept.
concept  jh::concepts::timed_mutex_like
 Timed variant of mutex_like.
concept  jh::concepts::rw_mutex_like
 Read-write (RW) mutex concept.
concept  jh::concepts::recursive_mutex
 Concept for counting reentrant (recursive) mutexes.
concept  jh::concepts::reentrant_mutex
 Concept for idempotent (structurally reentrant) mutexes.
concept  jh::concepts::reentrance_capable_mutex
 Concept for any mutex supporting some form of reentrance.

Detailed Description

Foundational synchronization concepts and reentrance traits.

Author
JeongHan-Bae <mastropseudo@gmail.com>

Defines the full concept hierarchy governing mutex-like types and provides trait registries for compile-time detection of reentrancy.

Concept Layers

  • Exclusive Lock Concepts: basic_lockable, excl_lockable, timed_excl_lockable
  • Shared Lock Concepts: shared_lockable, timed_shared_lockable
  • Unified Concepts: mutex_like, timed_mutex_like, rw_mutex_like
  • Reentrance Concepts: reentrant_mutex, recursive_mutex, reentrance_capable_mutex

Design Intent

  • Provide strong concept constraints for lock-like objects.
  • Enable compile-time validation of synchronization primitives.
  • Allow zero-cost substitution of structural locks (e.g., null_mutex_t).
Version
1.3.x
Date
2025