MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
ServerThread.hpp File Reference

Platform-specific threading wrapper for Server class. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Lila::ServerThread
 Fallback std::thread-based thread wrapper with manual stop signaling. More...
 
class  Lila::ServerThread::StopToken
 API-compatible stop token for platforms without std::stop_token. More...
 

Namespaces

namespace  Lila
 

Macros

#define MAYAFLUX_JTHREAD_BROKEN   1
 

Detailed Description

Platform-specific threading wrapper for Server class.

This header provides a surgical fix for std::jthread issues on specific platforms (notably Apple Clang 15 shipped with Xcode 15.x) WITHOUT disabling other C++23 features.

Detection Strategy:

  1. Check if __cpp_lib_jthread feature test macro indicates support
  2. On macOS, check Apple Clang compiler version specifically
  3. Apple Clang 15.x (15000000 - 15999999) has known jthread issues despite claiming support
  4. Fallback to std::thread + atomic flag only when jthread is actually broken

This does NOT affect any other C++23/C++20 features like:

  • std::expected
  • Coroutines (std::coroutine_handle)
  • std::atomic_ref
  • Structured bindings
  • Concepts
  • Ranges

Definition in file ServerThread.hpp.