Definition at line 65 of file XrdWait41.cc.
◆ XrdW41Gate()
XrdW41Gate::XrdW41Gate |
( |
| ) |
|
|
inline |
◆ ~XrdW41Gate()
XrdW41Gate::~XrdW41Gate |
( |
| ) |
|
|
inline |
◆ Serialize()
void XrdW41Gate::Serialize |
( |
XrdOucTList * |
gfP, |
|
|
int |
Wait = 1 |
|
) |
| |
|
static |
Definition at line 224 of file XrdWait41.cc.
231 bzero(&lock_args,
sizeof(lock_args));
232 lock_args.l_type = F_WRLCK;
233 Act = (Wait ? F_SETLKW : F_SETLK);
237 do {rc =
fcntl(gfP->val, Act, &lock_args);}
while(rc == -1 && errno == EINTR);
241 if (rc != -1) rc = 0;
243 std::cerr <<
"Serialize: " <<
XrdSysE2T(rc) <<
" locking FD " <<gfP->
text <<std::endl;
249 if (rc || gateOpen)
close(gfP->val);
int fcntl(int fd, int cmd,...)
const char * XrdSysE2T(int errcode)
References close, fcntl(), FLOCK_t, XrdOucTList::text, and XrdSysE2T().
Referenced by XrdWait41::GateWait().
◆ Wait41()
Definition at line 259 of file XrdWait41.cc.
261 static const int AMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
272 if (gateOpen) {gateMutex.
UnLock();
return 1;}
275 if ((gfP->val =
open(gfP->text, O_CREAT|O_RDWR, AMode)) < 0)
277 std::cerr <<
"Wait41: " <<eTxt <<
" opening " <<gfP->text <<std::endl;
282 std::cerr <<
"Wait41: " <<eTxt <<
" creating gate thread for "
283 <<gfP->text <<std::endl;
294 if (gateOpen) {gateMutex.
UnLock();
return 1;}
int open(const char *path, int oflag,...)
#define XRDSYSTHREAD_BIND
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
void * GateWait(void *parg)
References close, XrdWait41::GateWait(), open(), XrdSysThread::Run(), XrdOucTList::text, XrdSysE2T(), and XRDSYSTHREAD_BIND.
Referenced by main().
The documentation for this class was generated from the following file: