XRootD
XrdSysRWLockHelper Class Reference

#include <XrdSysPthread.hh>

+ Collaboration diagram for XrdSysRWLockHelper:

Public Member Functions

 XrdSysRWLockHelper (XrdSysRWLock &l, bool rd=1)
 
 XrdSysRWLockHelper (XrdSysRWLock *l=0, bool rd=1)
 
 ~XrdSysRWLockHelper ()
 
void Lock (XrdSysRWLock *lock, bool rd=1)
 
void UnLock ()
 

Detailed Description

Definition at line 397 of file XrdSysPthread.hh.

Constructor & Destructor Documentation

◆ XrdSysRWLockHelper() [1/2]

XrdSysRWLockHelper::XrdSysRWLockHelper ( XrdSysRWLock l = 0,
bool  rd = 1 
)
inline

Definition at line 412 of file XrdSysPthread.hh.

413  { if (l) {if (rd) l->ReadLock();
414  else l->WriteLock();
415  }
416  lck = l;
417  }

◆ XrdSysRWLockHelper() [2/2]

XrdSysRWLockHelper::XrdSysRWLockHelper ( XrdSysRWLock l,
bool  rd = 1 
)
inline

Definition at line 418 of file XrdSysPthread.hh.

419  { if (rd) l.ReadLock();
420  else l.WriteLock();
421  lck = &l;
422  }

References XrdSysRWLock::ReadLock(), and XrdSysRWLock::WriteLock().

+ Here is the call graph for this function:

◆ ~XrdSysRWLockHelper()

XrdSysRWLockHelper::~XrdSysRWLockHelper ( )
inline

Definition at line 424 of file XrdSysPthread.hh.

424 {if (lck) UnLock();}

References UnLock().

+ Here is the call graph for this function:

Member Function Documentation

◆ Lock()

void XrdSysRWLockHelper::Lock ( XrdSysRWLock lock,
bool  rd = 1 
)
inline

Definition at line 401 of file XrdSysPthread.hh.

402  {if (lck) {if (lck != lock) lck->UnLock();
403  else return;
404  }
405  if (rd) lock->ReadLock();
406  else lock->WriteLock();
407  lck = lock;
408  };

References XrdSysRWLock::ReadLock(), XrdSysRWLock::UnLock(), and XrdSysRWLock::WriteLock().

Referenced by XrdSutPFCache::Get().

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

◆ UnLock()

void XrdSysRWLockHelper::UnLock ( )
inline

Definition at line 410 of file XrdSysPthread.hh.

410 {if (lck) {lck->UnLock(); lck = 0;}}

References XrdSysRWLock::UnLock().

Referenced by ~XrdSysRWLockHelper(), and XrdSutPFCache::Get().

+ 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: