ORIGINAL
Loading...
Searching...
No Matches
thread.h File Reference

Thread management utilities. More...

#include "error.h"
#include "functional"
#include "pthread.h"
#include "ownerPtr.h"
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  original::threadBase
 Base class for thread implementations. More...
 
class  original::threadBase::threadData< Callback >
 Wrapper for thread execution data. More...
 
class  original::pThread
 POSIX thread implementation. More...
 
class  original::thread
 High-level thread wrapper. More...
 

Namespaces

namespace  original
 Main namespace for the project Original.
 

Detailed Description

Thread management utilities.

Provides a layered threading abstraction with:

  • Low-level POSIX thread wrapper (pThread)
  • High-level RAII thread management (thread)
  • Exception-safe thread operations
  • Flexible join/detach policies

Key Features:

  • Three-layer thread abstraction:
    1. threadBase - Common interface and state management
    2. pThread - POSIX thread wrapper
    3. thread - High-level RAII wrapper
  • Automatic resource management
  • Move-only semantics
  • Exception safety (basic guarantee)
  • Configurable join/detach behavior

Thread Safety:

  • Individual thread objects are not thread-safe
  • External synchronization required for shared access

Exception Handling:

  • Throws sysError for thread operation failures
  • Destructors may throw if thread is joinable and not joined/detached