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 |
Semaphore * | pQuotaSem |
Semaphore * | pTotalSem |
uint32_t | pRequestsLeft |
uint32_t | pFailureCounter |
A helper running a fixed number of requests at a given time.
XrdCl::RequestSync::RequestSync | ( | uint32_t | reqTotal, | |
uint32_t | reqQuota | |||
) | [inline] |
Constructor
reqTotal | total number of requests | |
reqQuota | number of requests to be run in parallel |
References XrdSysSemaphore::Post(), and pTotalSem.
XrdCl::RequestSync::RequestSync | ( | const RequestSync & | other | ) | [private] |
uint32_t XrdCl::RequestSync::FailureCount | ( | ) | const [inline] |
Number of tasks finishing with an error.
References pFailureCounter.
RequestSync& XrdCl::RequestSync::operator= | ( | const RequestSync & | other | ) | [private] |
void XrdCl::RequestSync::TaskDone | ( | bool | success = true |
) | [inline] |
Report the request finish.
References pFailureCounter, pMutex, XrdSysSemaphore::Post(), pQuotaSem, pRequestsLeft, and pTotalSem.
void XrdCl::RequestSync::WaitForAll | ( | ) | [inline] |
Wait for all the requests to be finished.
References pTotalSem, and XrdSysSemaphore::Wait().
void XrdCl::RequestSync::WaitForQuota | ( | ) | [inline] |
Wait for the request quota.
References pQuotaSem, and XrdSysSemaphore::Wait().
uint32_t XrdCl::RequestSync::pFailureCounter [private] |
Referenced by FailureCount(), and TaskDone().
XrdSysMutex XrdCl::RequestSync::pMutex [private] |
Referenced by TaskDone().
Semaphore* XrdCl::RequestSync::pQuotaSem [private] |
Referenced by TaskDone(), WaitForQuota(), and ~RequestSync().
uint32_t XrdCl::RequestSync::pRequestsLeft [private] |
Referenced by TaskDone().
Semaphore* XrdCl::RequestSync::pTotalSem [private] |
Referenced by RequestSync(), TaskDone(), WaitForAll(), and ~RequestSync().