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.

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

## ~XrdSysSemaphore()

XrdSysSemaphore::~XrdSysSemaphore | ( |  | ) |

inline

Definition at line 519 of file XrdSysPthread.hh.

{if (sem_destroy(&h_semaphore))
{abort();}
}

## Member Function Documentation

## CondWait()

int XrdSysSemaphore::CondWait | ( |  | ) |

inline

Definition at line 497 of file XrdSysPthread.hh.

{while(sem_trywait( &h_semaphore ))
{if (errno == EAGAIN) return 0;
if (errno != EINTR) { throw "sem_CondWait() failed";}
}
return 1;
}

## Post()

void XrdSysSemaphore::Post | ( |  | ) |

inline

Definition at line 505 of file XrdSysPthread.hh.

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

Referenced by XrdRmcReal::~XrdRmcReal(), XrdInet::Accept(), XrdSys::IOEvents::PollE::Begin(), XrdSys::IOEvents::PollKQ::Begin(), XrdSys::IOEvents::PollPoll::Begin(), XrdSys::IOEvents::PollPort::Begin(), XrdCmsAdmin::Relay(), XrdPollE::Start(), XrdPollPoll::Start(), XrdFrmConfigMum(), and XrdSysLoggerRT().

Here is the caller graph for this function:

## Wait()

void XrdSysSemaphore::Wait | ( |  | ) |

inline

Definition at line 509 of file XrdSysPthread.hh.

{while (sem_wait(&h_semaphore))
{if (EINTR != errno)
{throw "sem_wait() failed";}
}
}

Referenced by XrdRmcReal::~XrdRmcReal(), XrdSysLogger::Bind(), XrdFrmConfig::Configure(), XrdSys::IOEvents::Poller::Create(), XrdSys::IOEvents::Channel::Delete(), XrdRmcData::Detach(), XrdPollPoll::Disable(), XrdCmsConfig::DoIt(), XrdPollPoll::Exclude(), XrdCl::ExecuteActions(), XrdSsiFileReq::Finalize(), XrdSsiTaskReal::Kill(), mainAccept(), XrdCmsAdmin::Relay(), XrdCl::CopyProcess::Run(), XrdSys::IOEvents::Poller::SendCmd(), XrdXrootdFile::Serialize(), and XrdFrmXfrQueue::StopMon().

Here is the caller graph for this function:

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

- XrdSysPthread.hh