FOSSredder 0.5.0
Loading...
Searching...
No Matches
core::jobs::SlotLimiter Class Reference

Limits concurrent access to a bounded number of slots. More...

#include <Scheduler.h>

Public Member Functions

 SlotLimiter (std::size_t slots)
 Create a limiter with at least one available slot.
void acquire ()
 Block until a slot is available and acquire it.
void release ()
 Release one acquired slot and wake a waiting caller.

Detailed Description

Limits concurrent access to a bounded number of slots.

Definition at line 27 of file Scheduler.h.

Constructor & Destructor Documentation

◆ SlotLimiter()

core::jobs::SlotLimiter::SlotLimiter ( std::size_t slots)
explicit

Create a limiter with at least one available slot.

Parameters
slotsMaximum number of concurrent acquisitions.

Definition at line 21 of file Scheduler.cpp.

Member Function Documentation

◆ acquire()

void core::jobs::SlotLimiter::acquire ( )

Block until a slot is available and acquire it.

Definition at line 27 of file Scheduler.cpp.

◆ release()

void core::jobs::SlotLimiter::release ( )

Release one acquired slot and wake a waiting caller.

Definition at line 34 of file Scheduler.cpp.


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