Loading...
Searching...
No Matches
XrdOfsHanXpr Class Reference
Collaboration diagram for XrdOfsHanXpr:

## Public Member Functions

| XrdOfsHanXpr (XrdOfsHandle *hP, XrdOfsHanCB *cbP, time_t xtm)
| ~XrdOfsHanXpr ()
void | add2Q (int doLK=1)
void | Deref ()
void | Set (XrdOfsHanCB *cbP, time_t xtm)

## Static Public Member Functions

static XrdOfsHanXpr * | Get ()

## Friends

class | XrdOfsHandle

## Detailed Description

Definition at line 161 of file XrdOfsHandle.cc.

## Constructor & Destructor Documentation

## XrdOfsHanXpr()

XrdOfsHanXpr::XrdOfsHanXpr | ( | XrdOfsHandle * | hP,
|  | XrdOfsHanCB * | cbP,
|  | time_t | xtm )

inline

Definition at line 176 of file XrdOfsHandle.cc.

: Next(0), Handle(hP), Call(cbP), xTime(xtm), xTNew(0) {}

References XrdOfsHandle.

Referenced by add2Q(), and Get().

Here is the call graph for this function:
Here is the caller graph for this function:

## ~XrdOfsHanXpr()

XrdOfsHanXpr::~XrdOfsHanXpr | ( |  | ) |

inline

Definition at line 178 of file XrdOfsHandle.cc.

{}

## Member Function Documentation

## add2Q()

void XrdOfsHanXpr::add2Q | ( | int | doLK = 1 | ) |

Definition at line 781 of file XrdOfsHandle.cc.

{
XrdOfsHanXpr *xPP, *xP;
// Place this object on the deferred queue
//
if (doLK) xqCV.Lock();
xPP = 0; xP = xprQ;
while(xP && xP->xTime < xTime) {xPP = xP; xP = xP->Next;}
Next = xP;
if (xPP) {xPP->Next = this; if (doLK) xqCV.UnLock();}
else { xprQ = this; if (doLK) {xqCV.Signal(); xqCV.UnLock();}}
};
XrdOfsHanXpr::XrdOfsHanXpr
XrdOfsHanXpr(XrdOfsHandle *hP, XrdOfsHanCB *cbP, time_t xtm)
Definition XrdOfsHandle.cc:176

References XrdOfsHanXpr().

Referenced by Get(), and XrdOfsHandle::Retire().

Here is the call graph for this function:
Here is the caller graph for this function:

## Deref()

void XrdOfsHanXpr::Deref | ( |  | ) |

inline

Definition at line 168 of file XrdOfsHandle.cc.

{xqCV.Lock(); Handle=0; Call=0; xTNew=0; xqCV.UnLock();}

## Get()

XrdOfsHanXpr * XrdOfsHanXpr::Get | ( |  | ) |

static

Definition at line 801 of file XrdOfsHandle.cc.

{
XrdOfsHanXpr *xP;
XrdOfsHandle *hP;
int waitTime = 2592000;
// Obtain the xqCV lock as we need it to inspect/modify the queue and elements
// This lock is automatically released when we wait on the associated condvar.
//
xqCV.Lock();
// Caculate the next wait time based on the first element, if any, in the queue.
// If the wait time is positive then loop back to wait that amount of time. Note
// that we have the xqCV lock that is needed to touch an inq Xpr object.
//
do{do{if (!(xP = xprQ)) waitTime = 2592000;
else waitTime = xP->xTime - time(0);
if (waitTime > 0) break;
xprQ = xP->Next;
// Get the associated file handle. If none, simply delete the Xpr object.
//
if (!(hP = xP->Handle)) {delete xP; continue;}
// If a new wait time is indicated then reschedule this object
//
if (xP->xTNew)
{xP->xTime = xP->xTNew; xP->xTNew = 0;
xP->add2Q(0);
continue;
}
// Since we are still holding the xqCV lock we must get a conditional lock on
// the handle. If we can't then reschedule this object for later.
//
if (!(hP->WaitLock()))
{OfsEroute.Emsg("Retire", "defering retire of", hP->Path.Val);
xP->xTime = time(0)+30;
xP->add2Q(0);
continue;
}
// Drop the xqCV lock prior to returning the Xpr object to the caller. The
// caller will delete the object as needed.
//
xqCV.UnLock();
return xP;
} while(1);
// We have the xqCV lock so we can now wait for an event or a timeout
//
xqCV.Wait(waitTime);
} while(1);
}
OfsEroute
XrdSysError OfsEroute
XrdOfsHanKey::Val
const char * Val
Definition XrdOfsHandle.hh:50
XrdOfsHanXpr::XrdOfsHandle
friend class XrdOfsHandle
Definition XrdOfsHandle.cc:163
XrdOfsHanXpr::add2Q
void add2Q(int doLK=1)
Definition XrdOfsHandle.cc:781
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95

References XrdOfsHanXpr(), add2Q(), XrdOfsHandle::Lock(), OfsEroute, XrdOfsHanKey::Val, and XrdOfsHandle.

Referenced by XrdOfsHandle::StartXpr().

Here is the call graph for this function:
Here is the caller graph for this function:

## Set()

void XrdOfsHanXpr::Set | ( | XrdOfsHanCB * | cbP,
|  | time_t | xtm )

inline

Definition at line 173 of file XrdOfsHandle.cc.

{xqCV.Lock(); Call = cbP; xTNew = xtm; xqCV.UnLock();}

## Friends And Related Symbol Documentation

## XrdOfsHandle

friend class XrdOfsHandle

friend

Definition at line 163 of file XrdOfsHandle.cc.

References XrdOfsHandle.

Referenced by XrdOfsHanXpr(), Get(), and XrdOfsHandle.

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

- XrdOfsHandle.cc