![]() |
OpenMS
|
RAII slot guard for ConcurrencyLimiter — acquires on construction, releases on destruction. More...
#include <OpenMS/ANALYSIS/OPENSWATH/OpenSwathWorkflowScheduler.h>
Public Member Functions | |
| ScopedSlot (ConcurrencyLimiter *limiter) | |
Acquire a slot from limiter (blocking). If limiter is nullptr, the constructor is a no-op. | |
| ~ScopedSlot () | |
Release the slot back to the limiter (no-op if constructed with nullptr). | |
| ScopedSlot (const ScopedSlot &)=delete | |
| ScopedSlot & | operator= (const ScopedSlot &)=delete |
Private Attributes | |
| ConcurrencyLimiter * | limiter_ |
RAII slot guard for ConcurrencyLimiter — acquires on construction, releases on destruction.
The constructor calls ConcurrencyLimiter::acquireSlot on limiter (which may block); the destructor calls ConcurrencyLimiter::releaseSlot. Passing nullptr makes both operations no-ops, so guard sites that may or may not be limited can be written without branching. Not copyable nor movable.
|
explicit |
Acquire a slot from limiter (blocking). If limiter is nullptr, the constructor is a no-op.
| ~ScopedSlot | ( | ) |
Release the slot back to the limiter (no-op if constructed with nullptr).
|
delete |
|
delete |
|
private |