ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::semaphoreGuard< MAX_CNT > Class Template Reference

RAII wrapper for automatic semaphore management. More...

#include <semaphores.h>

Collaboration diagram for original::semaphoreGuard< MAX_CNT >:
Collaboration graph

Public Member Functions

 semaphoreGuard (semaphore< MAX_CNT > &sem)
 Constructs a guard and acquires the semaphore.
 
 ~semaphoreGuard ()
 Destructor that releases the semaphore.
 

Detailed Description

template<u_integer MAX_CNT>
class original::semaphoreGuard< MAX_CNT >

RAII wrapper for automatic semaphore management.

Template Parameters
MAX_CNTMaximum semaphore count (matches semaphore template parameter)

Acquires the semaphore on construction and automatically releases it on destruction. Ensures exception-safe semaphore usage and prevents resource leaks.

Constructor & Destructor Documentation

◆ semaphoreGuard()

template<original::u_integer MAX_CNT>
original::semaphoreGuard< MAX_CNT >::semaphoreGuard ( semaphore< MAX_CNT > &  sem)
explicit

Constructs a guard and acquires the semaphore.

Parameters
semSemaphore to manage

Calls sem.acquire() during construction

◆ ~semaphoreGuard()

Destructor that releases the semaphore.

Calls sem.release() during destruction


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