inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
ThreadManager Class Reference

A class that manages thread states and provides utilities for thread handling. More...

#include <thread_manager.hpp>

Classes

struct  ThreadState
 Represents the state of a thread managed by ThreadManager. More...
 

Public Member Functions

 ThreadManager ()
 Construct a ThreadManager with a worker thread pool.
 
auto getThreadState () -> ThreadState &
 Destructor to clean up resources and threads.
 
auto getWorkerThreadPool () -> WorkerThreadPool &
 Get the worker thread pool.
 
void lockPlayMutex (ThreadState &thread_state)
 Locks the play mutex for the provided thread state.
 
void lockQueueMutex (ThreadState &thread_state)
 Locks the queue mutex for the provided thread state.
 

Detailed Description

A class that manages thread states and provides utilities for thread handling.

Constructor & Destructor Documentation

◆ ThreadManager()

ThreadManager::ThreadManager ( )
inline

Construct a ThreadManager with a worker thread pool.

Member Function Documentation

◆ getThreadState()

auto ThreadManager::getThreadState ( ) -> ThreadState&
inline

Destructor to clean up resources and threads.

Retrieves the thread state managed by this ThreadManager.

Returns
A reference to the thread state.

◆ getWorkerThreadPool()

auto ThreadManager::getWorkerThreadPool ( ) -> WorkerThreadPool&
inline

Get the worker thread pool.

Returns
Reference to the WorkerThreadPool.

◆ lockPlayMutex()

void ThreadManager::lockPlayMutex ( ThreadState & thread_state)
inline

Locks the play mutex for the provided thread state.

Parameters
thread_stateReference to the ThreadState object whose mutex is to be locked.

◆ lockQueueMutex()

void ThreadManager::lockQueueMutex ( ThreadState & thread_state)
inline

Locks the queue mutex for the provided thread state.

Parameters
thread_stateReference to the ThreadState object whose mutex is to be locked.

The documentation for this class was generated from the following file: