CernVM-FS
2.12.0
|
#include <concurrency.h>
Public Member Functions | |
SynchronizingCounter () | |
SynchronizingCounter (const T maximal_value) | |
~SynchronizingCounter () | |
T | Increment () |
T | Decrement () |
void | WaitForZero () const |
bool | HasMaximalValue () const |
T | maximal_value () const |
T | operator++ () |
const T | operator++ (int) |
T | operator-- () |
const T | operator-- (int) |
T | Get () const |
SynchronizingCounter< T > & | operator= (const T &other) |
Protected Member Functions | |
void | SetValueUnprotected (const T new_value) |
void | WaitForFreeSlotUnprotected () |
Private Member Functions | |
void | Initialize () |
void | Destroy () |
Private Member Functions inherited from SingleCopy | |
SingleCopy () | |
Private Attributes | |
T | value_ |
const T | maximal_value_ |
pthread_mutex_t | mutex_ |
pthread_cond_t | became_zero_ |
pthread_cond_t | free_slot_ |
This counter can be counted up and down using the usual increment/decrement operators. It allows threads to wait for it to become zero as well as to block when a specified maximal value would be exceeded by an increment.
Note: If a maximal value is specified on creation, the SynchronizingCounter is assumed to never leave the interval [0, maximal_value]! Otherwise the numerical limits of the specified template parameter define this interval and an increment never blocks.
Caveat: This implementation uses a simple mutex mechanism and therefore might become a scalability bottle neck!
Definition at line 150 of file concurrency.h.
|
inline |
Definition at line 152 of file concurrency.h.
|
inlineexplicit |
Definition at line 155 of file concurrency.h.
|
inline |
Definition at line 163 of file concurrency.h.
|
inline |
Definition at line 172 of file concurrency.h.
Referenced by s3fanout::S3FanoutManager::MainUpload().
|
private |
Definition at line 58 of file concurrency_impl.h.
|
inline |
Definition at line 194 of file concurrency.h.
Referenced by s3fanout::S3FanoutManager::CallbackCurlSocket().
|
inline |
Definition at line 186 of file concurrency.h.
|
inline |
Definition at line 165 of file concurrency.h.
Referenced by s3fanout::S3FanoutManager::PushNewJob().
|
private |
|
inline |
Definition at line 187 of file concurrency.h.
|
inline |
Definition at line 189 of file concurrency.h.
|
inline |
Definition at line 190 of file concurrency.h.
|
inline |
Definition at line 191 of file concurrency.h.
|
inline |
Definition at line 192 of file concurrency.h.
|
inline |
Definition at line 199 of file concurrency.h.
|
protected |
This file is part of the CernVM File System.
Definition at line 21 of file concurrency_impl.h.
|
protected |
|
inline |
Definition at line 178 of file concurrency.h.
Referenced by upload::AbstractUploader::WaitForUpload().
|
mutableprivate |
Definition at line 218 of file concurrency.h.
|
private |
Definition at line 219 of file concurrency.h.
|
private |
Definition at line 215 of file concurrency.h.
|
mutableprivate |
Definition at line 217 of file concurrency.h.
|
private |
Definition at line 214 of file concurrency.h.