XRootD
Loading...
Searching...
No Matches
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()

void XrdSysSemaphore::Post ( )
inline

Definition at line 505 of file XrdSysPthread.hh.

505 {if (sem_post(&h_semaphore))
506 {throw "sem_post() failed";}
507 }

Referenced by XrdCms::AdminReq::AdminReq(), XrdCl::RequestSync::RequestSync(), XrdCl::barrier_t::~barrier_t(), XrdRmcReal::~XrdRmcReal(), XrdInet::Accept(), XrdCmsRRQ::Add(), XrdMpxOut::Add(), XrdFrmXfrQueue::Add(), XrdSys::IOEvents::PollE::Begin(), XrdSys::IOEvents::PollKQ::Begin(), XrdSys::IOEvents::PollPoll::Begin(), XrdSys::IOEvents::PollPort::Begin(), XrdPosixFile::DelayedDestroy(), XrdCmsClientMan::delayResp(), XrdScheduler::DoIt(), XrdSsiFileReq::DoIt(), XrdCmsRespCB::Done(), XrdBwmPolicy1::Done(), XrdCmsState::Enable(), XrdBwmLogger::Event(), XrdOfsEvs::Notify(), XrdRmcData::Preread(), XrdRmcReal::PreRead(), XrdCl::SyncQueue< Item >::Put(), XrdCmsPrepArgs::Queue(), XrdCmsRRQ::Ready(), XrdXrootdFile::Ref(), XrdCmsProtocol::Ref(), XrdCmsAdmin::Relay(), XrdCmsResp::Reply(), XrdCms::AdminReq::Requeue(), XrdScheduler::Schedule(), XrdScheduler::Schedule(), XrdSecTLayer::secXeq(), XrdW41Gate::Serialize(), XrdLink::setRef(), XrdOssSys::Stage_RT(), XrdCmsAdmin::Start(), XrdPollE::Start(), XrdPollPoll::Start(), XrdFrmXfrQueue::StopMon(), XrdCl::RequestSync::TaskDone(), XrdCmsRRQ::TimeOut(), XrdSysXSLock::UnLock(), XrdCmsState::Update(), XrdFrmReqBoss::Wakeup(), XrdSsiTaskReal::XeqEvent(), XrdFrmConfigMum(), and XrdSysLoggerRT().

+ Here is the caller graph for this function:

◆ Wait()


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