xrootd
|
A helper running a fixed number of requests at a given time. More...
#include <XrdClRequestSync.hh>
Public Member Functions | |
RequestSync (uint32_t reqTotal, uint32_t reqQuota) | |
~RequestSync () | |
Destructor. | |
void | WaitForQuota () |
Wait for the request quota. | |
void | WaitForAll () |
Wait for all the requests to be finished. | |
void | TaskDone (bool success=true) |
Report the request finish. | |
uint32_t | FailureCount () const |
Number of tasks finishing with an error. | |
Private Member Functions | |
RequestSync (const RequestSync &other) | |
RequestSync & | operator= (const RequestSync &other) |
Private Attributes | |
XrdSysMutex | pMutex |
XrdSysSemaphore * | pQuotaSem |
XrdSysSemaphore * | pTotalSem |
uint32_t | pRequestsLeft |
uint32_t | pFailureCounter |
A helper running a fixed number of requests at a given time.
|
inline |
Constructor
reqTotal | total number of requests |
reqQuota | number of requests to be run in parallel |
References XrdSysSemaphore::Post(), and pTotalSem.
|
private |
|
inline |
Number of tasks finishing with an error.
References pFailureCounter.
|
private |
|
inline |
Report the request finish.
References pFailureCounter, pMutex, XrdSysSemaphore::Post(), pQuotaSem, pRequestsLeft, and pTotalSem.
|
inline |
Wait for all the requests to be finished.
References pTotalSem, and XrdSysSemaphore::Wait().
|
inline |
Wait for the request quota.
References pQuotaSem, and XrdSysSemaphore::Wait().
|
private |
Referenced by FailureCount(), and TaskDone().
|
private |
Referenced by TaskDone().
|
private |
Referenced by TaskDone(), WaitForQuota(), and ~RequestSync().
|
private |
Referenced by TaskDone().
|
private |
Referenced by RequestSync(), TaskDone(), WaitForAll(), and ~RequestSync().