Loading...
Searching...
No Matches
XrdSysThread Class Reference

`#include <XrdSysPthread.hh>`

Collaboration diagram for XrdSysThread:

## Public Member Functions

| XrdSysThread ()
| ~XrdSysThread ()

## Static Public Member Functions

static int | Cancel (pthread_t tid)
static void | CancelPoint ()
static int | Detach (pthread_t tid)
static pthread_t | ID (void)
static int | Join (pthread_t tid, void **ret)
static int | Kill (pthread_t tid)
static unsigned long | Num (void)
static int | Run (pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
static int | Same (pthread_t t1, pthread_t t2)
static int | SetCancelAsynchronous ()
static int | SetCancelDeferred ()
static int | SetCancelOff ()
static int | SetCancelOn ()
static void | setDebug (XrdSysError *erp)
static void | setStackSize (size_t stsz, bool force=false)
static int | Signal (pthread_t tid, int snum)
static int | Wait (pthread_t tid)

## Detailed Description

Definition at line 550 of file XrdSysPthread.hh.

## Constructor & Destructor Documentation

## XrdSysThread()

XrdSysThread::XrdSysThread | ( |  | ) |

inline

Definition at line 605 of file XrdSysPthread.hh.

{}

## ~XrdSysThread()

XrdSysThread::~XrdSysThread | ( |  | ) |

inline

Definition at line 606 of file XrdSysPthread.hh.

{}

## Member Function Documentation

## Cancel()

int XrdSysThread::Cancel | ( | pthread_t | tid | ) |

inline static

Definition at line 554 of file XrdSysPthread.hh.

{return pthread_cancel(tid);}

## CancelPoint()

void XrdSysThread::CancelPoint | ( |  | ) |

inline static

Definition at line 579 of file XrdSysPthread.hh.

{
pthread_testcancel();
};

## Detach()

int XrdSysThread::Detach | ( | pthread_t | tid | ) |

inline static

Definition at line 556 of file XrdSysPthread.hh.

{return pthread_detach(tid);}

## ID()

pthread_t XrdSysThread::ID | ( | void |  | ) |

inline static

Definition at line 584 of file XrdSysPthread.hh.

{return pthread_self();}

Referenced by XrdSys::IOEvents::Channel::Delete(), XrdOucBackTrace::DoBT(), XrdSys::IOEvents::BootStrap::Start(), and XrdOucBackTrace::XrdBT().

Here is the caller graph for this function:

## Join()

int XrdSysThread::Join | ( | pthread_t | tid,
|  | void ** | ret )

inline static

Definition at line 563 of file XrdSysPthread.hh.

{
return pthread_join(tid, ret);
};

Referenced by XrdSecsssKT::~XrdSecsssKT().

Here is the caller graph for this function:

## Kill()

int XrdSysThread::Kill | ( | pthread_t | tid | ) |

inline static

Definition at line 586 of file XrdSysPthread.hh.

{return pthread_cancel(tid);}

Referenced by XrdBwmLogger::~XrdBwmLogger(), XrdCmsMeter::~XrdCmsMeter(), XrdOfsEvs::~XrdOfsEvs(), XrdSecsssKT::~XrdSecsssKT(), and XrdSysLogger::Bind().

Here is the caller graph for this function:

## Num()

unsigned long XrdSysThread::Num | ( | void |  | ) |

static

Definition at line 290 of file XrdSysPthread.cc.

{
#if defined(__linux__)
return static_cast<unsigned long>(syscall(SYS_gettid));
#elif defined(__solaris__)
return static_cast<unsigned long>(pthread_self());
#elif defined(__APPLE__)
return static_cast<unsigned long>(pthread_mach_thread_np(pthread_self()));
#else
return static_cast<unsigned long>(getpid());
#endif
}

Referenced by XrdThrottleManager::CloseFile(), XrdThrottleManager::OpenFile(), and XrdSysLogger::Put().

Here is the caller graph for this function:

## Run()

int XrdSysThread::Run | ( | pthread_t * | tid,
|  | void *(* | proc )(void *),
|  | void * | arg,
|  | int | opts = 0,
|  | const char * | desc = 0 )

static

Definition at line 307 of file XrdSysPthread.cc.

{
pthread_attr_t tattr;
XrdSysThreadArgs *myargs;
myargs = new XrdSysThreadArgs(eDest, tDesc, proc, arg);
pthread_attr_init(&tattr);
if ( opts & XRDSYSTHREAD_BIND)
pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
if (!(opts & XRDSYSTHREAD_HOLD))
pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
if (stackSize)
pthread_attr_setstacksize(&tattr, stackSize);
return pthread_create(tid, &tattr, XrdSysThread_Xeq,
static_cast<void *>(myargs));
}
opts
struct myOpts opts
XrdSysThread_Xeq
void * XrdSysThread_Xeq(void *myargs)
Definition XrdSysPthread.cc:79
XRDSYSTHREAD_BIND
#define XRDSYSTHREAD_BIND
Definition XrdSysPthread.hh:543
XRDSYSTHREAD_HOLD
#define XRDSYSTHREAD_HOLD
Definition XrdSysPthread.hh:548

References opts, XRDSYSTHREAD_BIND, XRDSYSTHREAD_HOLD, and XrdSysThread_Xeq().

Referenced by XrdOssStats::FileSystem::FileSystem(), XrdRmcReal::XrdRmcReal(), XrdSecsssKT::XrdSecsssKT(), XrdTlsTempCA::XrdTlsTempCA(), XrdOssSys::AioInit(), XrdSysLogger::Bind(), XrdOucLogging::configLog(), XrdOssSys::ConfigStageC(), XrdAccConfig::Configure(), XrdCmsFinderTRG::Configure(), XrdOssSys::Configure(), XrdSysLogging::Configure(), XrdSys::IOEvents::Poller::Create(), XrdCmsConfig::DoIt(), XrdScheduler::Fork(), XrdPosixFileRH::HandleResponse(), XrdBuffManager::Init(), XrdCmsCache::Init(), XrdCmsMeter::Init(), XrdCmsRRQ::Init(), XrdFrmMonitor::Init(), XrdFrmTransfer::Init(), XrdFrmXfrQueue::Init(), XrdOfsEvr::Init(), XrdThrottleManager::Init(), XrdXrootdAdmin::Init(), XrdCmsAdmin::InitAREvents(), main(), mainConfig(), XrdOssMio::Map(), XrdFrmMigrate::Migrate(), XrdCmsMeter::Monitor(), XrdCmsMeter::Monitor(), XrdFrmXfrDaemon::Pong(), XrdCmsFinderTRG::RunAdmin(), XrdOfsTPCAuth::RunTTL(), XrdPosixFileRH::Sched(), XrdTlsContext::SetCrlRefresh(), XrdBwmHandle::setPolicy(), XrdPoll::Setup(), XrdTlsFlush::Setup_Flusher(), XrdBwmLogger::Start(), XrdCmsAdmin::Start(), XrdCmsBaseFS::Start(), XrdFrmReqBoss::Start(), XrdOfsEvs::Start(), XrdOfsTPCProg::Start(), XrdScheduler::Start(), XrdXrootdAdmin::Start(), XrdOfsHandle::StartXpr(), XrdW41Gate::Wait41(), XrdOucGetCache(), and XrdSysLogger::zHandler().

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

## Same()

int XrdSysThread::Same | ( | pthread_t | t1,
|  | pthread_t | t2 )

inline static

Definition at line 593 of file XrdSysPthread.hh.

{return pthread_equal(t1, t2);}

Referenced by XrdSys::IOEvents::Channel::Delete().

Here is the caller graph for this function:

## SetCancelAsynchronous()

int XrdSysThread::SetCancelAsynchronous | ( |  | ) |

inline static

Definition at line 571 of file XrdSysPthread.hh.

{
return pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
};

## SetCancelDeferred()

int XrdSysThread::SetCancelDeferred | ( |  | ) |

inline static

Definition at line 575 of file XrdSysPthread.hh.

{
return pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, 0);
};

## SetCancelOff()

int XrdSysThread::SetCancelOff | ( |  | ) |

inline static

Definition at line 559 of file XrdSysPthread.hh.

{
return pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0);
};

## SetCancelOn()

int XrdSysThread::SetCancelOn | ( |  | ) |

inline static

Definition at line 567 of file XrdSysPthread.hh.

{
return pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
};

## setDebug()

void XrdSysThread::setDebug | ( | XrdSysError * | erp | ) |

inline static

Definition at line 596 of file XrdSysPthread.hh.

{eDest = erp;}

Referenced by XrdConfig::Configure().

Here is the caller graph for this function:

## setStackSize()

void XrdSysThread::setStackSize | ( | size_t | stsz,
|  | bool | force = false )

static

Definition at line 330 of file XrdSysPthread.cc.

{
// If not being forced, then we set the stacksize only if the requested
// size is greater than the default size.
//
if (!force)
{pthread_attr_t tattr;
size_t dflt_stk_sz;
pthread_attr_init(&tattr);
if (pthread_attr_getstacksize(&tattr, &dflt_stk_sz) || stksz <= dflt_stk_sz)
{stackSize = 0;
return;
}
}
// Record the stack size for future use
//
stackSize = stksz;
}

Referenced by main().

Here is the caller graph for this function:

## Signal()

int XrdSysThread::Signal | ( | pthread_t | tid,
|  | int | snum )

inline static

Definition at line 600 of file XrdSysPthread.hh.

{return pthread_kill(tid, snum);}

## Wait()

int XrdSysThread::Wait | ( | pthread_t | tid | ) |

static

Definition at line 354 of file XrdSysPthread.cc.

{
int retc, *tstat;
if ((retc = pthread_join(tid, reinterpret_cast<void **>(&tstat)))) return retc;
return *tstat;
}

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

- XrdSysPthread.hh
- XrdSysPthread.cc