XRootD
XrdSysSemaphore Class Reference

#include <XrdSysPthread.hh>

+ Collaboration diagram for XrdSysSemaphore:

Public Member Functions

 XrdSysSemaphore (int semval=1, const char *=0)
 
 ~XrdSysSemaphore ()
 
int CondWait ()
 
void Post ()
 
void Wait ()
 

Detailed Description

Definition at line 493 of file XrdSysPthread.hh.

Constructor & Destructor Documentation

◆ XrdSysSemaphore()

XrdSysSemaphore::XrdSysSemaphore ( int  semval = 1,
const char *  = 0 
)
inline

Definition at line 515 of file XrdSysPthread.hh.

516  {if (sem_init(&h_semaphore, 0, semval))
517  {throw "sem_init() failed";}
518  }

◆ ~XrdSysSemaphore()

XrdSysSemaphore::~XrdSysSemaphore ( )
inline

Definition at line 519 of file XrdSysPthread.hh.

519  {if (sem_destroy(&h_semaphore))
520  {abort();}
521  }

Member Function Documentation

◆ CondWait()

int XrdSysSemaphore::CondWait ( )
inline

Definition at line 497 of file XrdSysPthread.hh.

498  {while(sem_trywait( &h_semaphore ))
499  {if (errno == EAGAIN) return 0;
500  if (errno != EINTR) { throw "sem_CondWait() failed";}
501  }
502  return 1;
503  }

Referenced by XrdCmsRespCB::Init().

+ Here is the caller graph for this function:

◆ Post()

◆ Wait()


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