Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
jthread_compat.h File Reference

Compatibility header for std::jthread and std::stop_token kcenon. More...

#include <kcenon/common/config/feature_flags.h>
#include <atomic>
#include <condition_variable>
#include <functional>
#include <mutex>
#include <thread>
Include dependency graph for jthread_compat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::logger::async::simple_stop_source
 Simple stop source for environments without std::stop_token. More...
 
class  kcenon::logger::async::compat_jthread
 Wrapper for std::jthread or std::thread with manual stop mechanism. More...
 
class  kcenon::logger::async::compat_cv_wait
 Condition variable wait helper with stop support. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::logger
 
namespace  kcenon::logger::async
 

Macros

#define LOGGER_HAS_JTHREAD   KCENON_HAS_JTHREAD
 

Detailed Description

Compatibility header for std::jthread and std::stop_token kcenon.

Since
1.3.0

This header provides compatibility macros and fallback implementations for environments where std::jthread is not available (e.g., libc++ on macOS/Clang).

Detection Strategy:

  • Check for __cpp_lib_jthread feature test macro (P0660R10)
  • Check for libc++ which doesn't fully support jthread yet
  • Provide manual stop mechanism fallback when jthread is unavailable
Note
This is an internal header, not part of the public API

Definition in file jthread_compat.h.

Macro Definition Documentation

◆ LOGGER_HAS_JTHREAD

#define LOGGER_HAS_JTHREAD   KCENON_HAS_JTHREAD

Definition at line 37 of file jthread_compat.h.