Loading...
Searching...
No Matches
XrdSysRWLock Class Reference

`#include <XrdSysPthread.hh>`

Collaboration diagram for XrdSysRWLock:

## Public Types

enum | PrefType { prefWR =1 }

## Public Member Functions

| XrdSysRWLock ()
| XrdSysRWLock (PrefType)
| ~XrdSysRWLock ()
int | CondReadLock ()
int | CondWriteLock ()
void | ReadLock ()
void | ReadLock (int &status)
void | ReInitialize ()
void | ReInitialize (PrefType)
void | UnLock ()
void | WriteLock ()
void | WriteLock (int &status)

## Protected Attributes

pthread_rwlock_t | lock

## Detailed Description

Definition at line 329 of file XrdSysPthread.hh.

## Member Enumeration Documentation

## PrefType

enum XrdSysRWLock::PrefType

Enumerator
prefWR |

Definition at line 350 of file XrdSysPthread.hh.

{prefWR=1};
XrdSysRWLock::prefWR
@ prefWR
Definition XrdSysPthread.hh:350

## Constructor & Destructor Documentation

## XrdSysRWLock() [1/2]

XrdSysRWLock::XrdSysRWLock | ( | PrefType |  | ) |

inline

Definition at line 352 of file XrdSysPthread.hh.

{
#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
pthread_rwlockattr_t attr;
pthread_rwlockattr_setkind_np(&attr,
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
pthread_rwlock_init(&lock, &attr);
#else
pthread_rwlock_init(&lock, NULL);
#endif
}
XrdSysRWLock::lock
pthread_rwlock_t lock
Definition XrdSysPthread.hh:388

References lock.

## XrdSysRWLock() [2/2]

XrdSysRWLock::XrdSysRWLock | ( |  | ) |

inline

Definition at line 364 of file XrdSysPthread.hh.

{pthread_rwlock_init(&lock, NULL);}

References lock.

## ~XrdSysRWLock()

XrdSysRWLock::~XrdSysRWLock | ( |  | ) |

inline

Definition at line 365 of file XrdSysPthread.hh.

{pthread_rwlock_destroy(&lock);}

References lock.

## Member Function Documentation

## CondReadLock()

int XrdSysRWLock::CondReadLock | ( |  | ) |

inline

Definition at line 333 of file XrdSysPthread.hh.

{if (pthread_rwlock_tryrdlock( &lock )) return 0;
return 1;
}

References lock.

Referenced by XrdPosixObject::Dir(), and XrdPosixObject::File().

Here is the caller graph for this function:

## CondWriteLock()

int XrdSysRWLock::CondWriteLock | ( |  | ) |

inline

Definition at line 337 of file XrdSysPthread.hh.

{if (pthread_rwlock_trywrlock( &lock )) return 0;
return 1;
}

References lock.

Referenced by XrdPosixObject::Dir(), and XrdPosixObject::File().

Here is the caller graph for this function:

## ReadLock() [1/2]

void XrdSysRWLock::ReadLock | ( |  | ) |

inline

Definition at line 342 of file XrdSysPthread.hh.

{pthread_rwlock_rdlock(&lock);}

References lock.

Referenced by XrdSysRWLockHelper::XrdSysRWLockHelper(), XrdTlsFlush::Flusher(), XrdSutCache::Get(), XrdSutCache::Get(), XrdSysRWLockHelper::Lock(), XrdCmsNode::n2gLock(), and XrdTlsCrl::Refresh().

Here is the caller graph for this function:

## ReadLock() [2/2]

void XrdSysRWLock::ReadLock | ( | int & | status | ) |

inline

Definition at line 345 of file XrdSysPthread.hh.

{status = pthread_rwlock_rdlock(&lock);}

References lock.

## ReInitialize() [1/2]

void XrdSysRWLock::ReInitialize | ( |  | ) |

inline

Definition at line 380 of file XrdSysPthread.hh.

{
pthread_rwlock_destroy(&lock);
pthread_rwlock_init(&lock, NULL);
}

References lock.

## ReInitialize() [2/2]

void XrdSysRWLock::ReInitialize | ( | PrefType |  | ) |

inline

Definition at line 367 of file XrdSysPthread.hh.

{
pthread_rwlock_destroy(&lock);
#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
pthread_rwlockattr_t attr;
pthread_rwlockattr_setkind_np(&attr,
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
pthread_rwlock_init(&lock, &attr);
#else
pthread_rwlock_init(&lock, NULL);
#endif
}

References lock.

## UnLock()

void XrdSysRWLock::UnLock | ( |  | ) |

inline

Definition at line 348 of file XrdSysPthread.hh.

{pthread_rwlock_unlock(&lock);}

References lock.

Referenced by XrdTlsFlush::Flusher(), XrdCmsNode::g2nLock(), XrdSutCache::Get(), XrdCryptosslX509Crl::IsRevoked(), XrdCryptosslX509Crl::IsRevoked(), XrdTlsCrl::Refresh(), XrdCmsCluster::Remove(), and XrdTlsFlush::Setup_Flusher().

Here is the caller graph for this function:

## WriteLock() [1/2]

void XrdSysRWLock::WriteLock | ( |  | ) |

inline

Definition at line 343 of file XrdSysPthread.hh.

{pthread_rwlock_wrlock(&lock);}

References lock.

Referenced by XrdSysRWLockHelper::XrdSysRWLockHelper(), XrdSutCache::Get(), XrdSysRWLockHelper::Lock(), XrdCmsNode::n2gLock(), XrdTlsCrl::Refresh(), XrdCmsCluster::Remove(), and XrdTlsFlush::Setup_Flusher().

Here is the caller graph for this function:

## WriteLock() [2/2]

void XrdSysRWLock::WriteLock | ( | int & | status | ) |

inline

Definition at line 346 of file XrdSysPthread.hh.

{status = pthread_rwlock_wrlock(&lock);}

References lock.

## Member Data Documentation

## lock

pthread_rwlock_t XrdSysRWLock::lock

protected

Definition at line 388 of file XrdSysPthread.hh.

Referenced by XrdSysRWLock(), XrdSysRWLock(), ~XrdSysRWLock(), CondReadLock(), CondWriteLock(), ReadLock(), ReadLock(), ReInitialize(), ReInitialize(), UnLock(), WriteLock(), and WriteLock().

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

- XrdSysPthread.hh