XRootD
Loading...
Searching...
No Matches
XrdXrootdFileHP Class Reference

#include <XrdXrootdFile.hh>

+ Collaboration diagram for XrdXrootdFileHP:

Public Member Functions

 XrdXrootdFileHP (int rsv=2)
 
void Avail (int fHandle)
 
void Delete ()
 
int Get ()
 
void Ref ()
 

Detailed Description

Definition at line 44 of file XrdXrootdFile.hh.

Constructor & Destructor Documentation

◆ XrdXrootdFileHP()

XrdXrootdFileHP::XrdXrootdFileHP ( int rsv = 2)
inline

Definition at line 76 of file XrdXrootdFile.hh.

76 : refs(1), noMore(false)
77 {fhAvail.reserve(rsv);}

Member Function Documentation

◆ Avail()

void XrdXrootdFileHP::Avail ( int fHandle)
inline

Definition at line 48 of file XrdXrootdFile.hh.

48 {fhMutex.Lock();
49 bool done = (1 == refs--);
50 if (noMore)
51 {fhMutex.UnLock();
52 if (done) delete this;
53 } else {
54 fhAvail.push_back(fHandle);
55 fhMutex.UnLock();
56 }
57 }

References XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

Referenced by XrdXrootdFile::~XrdXrootdFile().

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

◆ Delete()

void XrdXrootdFileHP::Delete ( )
inline

Definition at line 59 of file XrdXrootdFile.hh.

59 {fhMutex.Lock();
60 if (!refs) {fhMutex.UnLock(); delete this;}
61 else {noMore = true; fhMutex.UnLock();}
62 }

References XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

Referenced by XrdXrootdFileTable::Recycle().

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

◆ Get()

int XrdXrootdFileHP::Get ( )
inline

Definition at line 64 of file XrdXrootdFile.hh.

64 {int fh;
65 fhMutex.Lock();
66 if (fhAvail.empty()) fh = -1;
67 else {fh = fhAvail.back();
68 fhAvail.pop_back();
69 }
70 fhMutex.UnLock();
71 return fh;
72 }

References XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

Referenced by XrdXrootdFileTable::Add().

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

◆ Ref()

void XrdXrootdFileHP::Ref ( )
inline

Definition at line 74 of file XrdXrootdFile.hh.

74{fhMutex.Lock(); refs++; fhMutex.UnLock();}

References XrdSysMutex::Lock(), and XrdSysMutex::UnLock().

Referenced by XrdXrootdFileTable::Del().

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

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