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

ThreadStategetThreadState ()
 Retrieves the thread state managed by this ThreadManager.
 
void lockPlayMutex (ThreadState &thread_state)
 Locks the play mutex for the provided thread state.
 
void unlockPlayMutex (ThreadState &thread_state)
 Unlocks the play mutex for the provided thread state.
 

Detailed Description

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

Member Function Documentation

◆ getThreadState()

ThreadState & ThreadManager::getThreadState ( )
inline

Retrieves the thread state managed by this ThreadManager.

Returns
A reference to the thread state.

◆ lockPlayMutex()

void ThreadManager::lockPlayMutex ( ThreadState & thread_state)
inline

Locks the play mutex for the provided thread state.

This function uses a unique lock to ensure that the play mutex is safely locked while performing operations on the thread state.

Parameters
thread_stateA reference to the ThreadState object whose mutex is to be locked.

◆ unlockPlayMutex()

void ThreadManager::unlockPlayMutex ( ThreadState & thread_state)
inline

Unlocks the play mutex for the provided thread state.

This function releases the lock on the play mutex that was previously acquired using lockPlayMutex. The play mutex will be unlocked after this function is called.

Parameters
thread_stateA reference to the ThreadState object whose mutex is to be unlocked.
Note
This function should be used in conjunction with lockPlayMutex to ensure proper synchronization.

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