Skip to content

Commit

Permalink
Revert "Extend Pause/Resume to all platforms and remove CPU burner wh…
Browse files Browse the repository at this point in the history
…en paused."

This reverts commit c52bc62.
  • Loading branch information
ljanyst committed Oct 31, 2013
1 parent 096a125 commit dc56cad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/XrdSys/XrdSysIOEvents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ void XrdSys::IOEvents::Poller::Detach(XrdSys::IOEvents::Channel *cP,
// Warning: This method runs unlocked. The caller must have exclusive use of
// the reqBuff otherwise unpredictable results will occur.

int XrdSys::IOEvents::Poller::GetRequest(int tmo)
int XrdSys::IOEvents::Poller::GetRequest()
{
ssize_t rlen;
int rc;
Expand All @@ -829,7 +829,7 @@ int XrdSys::IOEvents::Poller::GetRequest(int tmo)
// Wait for the next request. Some OS's (like Linux) don't support non-blocking
// pipes. So, we must front the read with a poll.
//
do {rc = poll(&pipePoll, 1, tmo);}
do {rc = poll(&pipePoll, 1, 0);}
while(rc < 0 && (errno == EAGAIN || errno == EINTR));
if (rc < 1) return 0;

Expand Down
2 changes: 1 addition & 1 deletion src/XrdSys/XrdSysIOEvents.hh
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ struct PipeData;
bool CbkXeq(Channel *cP, int events, int eNum, const char *eTxt);
inline int GetFault(Channel *cP) {return cP->chFault;}
inline int GetPollEnt(Channel *cP) {return cP->pollEnt;}
int GetRequest(int tmo=0);
int GetRequest();
bool Init(Channel *cP, int &eNum, const char **eTxt, bool &isLockd);
inline void LockChannel(Channel *cP) {cP->chMutex.Lock();}
int Poll2Enum(short events);
Expand Down
6 changes: 3 additions & 3 deletions src/XrdSys/XrdSysIOEventsPollE.icc
Original file line number Diff line number Diff line change
Expand Up @@ -354,22 +354,22 @@ bool XrdSys::IOEvents::PollE::Modify(XrdSys::IOEvents::Channel *cP,

bool XrdSys::IOEvents::PollE::Process()
{
int tmo = 0;
bool paused = false;

// Get the pipe request and check out actions of interest.
//

do{if (GetRequest())
{ if (reqBuff.req == PipeData::Post) reqBuff.theSem->Post();
else if (reqBuff.req == PipeData::Wait){reqBuff.theSem->Post();
tmo = -1;
paused = true;
}
else if (reqBuff.req == PipeData::Cont) break;
else if (reqBuff.req == PipeData::Stop){reqBuff.theSem->Post();
return false;
}
}
} while(tmo);
} while(paused);

// Return true
//
Expand Down
9 changes: 1 addition & 8 deletions src/XrdSys/XrdSysIOEventsPollPoll.icc
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,9 @@ bool XrdSys::IOEvents::PollPoll::Modify(XrdSys::IOEvents::Channel *cP,

bool XrdSys::IOEvents::PollPoll::Process()
{
int tmo = 0;

// Get the pipe request and check out actions of interest.
//
while(GetRequest(tmo))
while(GetRequest())
{switch(reqBuff.req)
{case PipeData::MdFD: FDMod(reqBuff.ent, reqBuff.fd, reqBuff.evt);
break;
Expand All @@ -491,11 +489,6 @@ bool XrdSys::IOEvents::PollPoll::Process()
case PipeData::NoOp: break;
case PipeData::Post: reqBuff.theSem->Post();
break;
case PipeData::Wait: reqBuff.theSem->Post();
tmo = -1;
break;
case PipeData::Cont: tmo = 0;
break;
case PipeData::Stop: reqBuff.theSem->Post();
return false;
break;
Expand Down
27 changes: 8 additions & 19 deletions src/XrdSys/XrdSysIOEventsPollPort.icc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ void XrdSys::IOEvents::PollPort::Begin(XrdSysSemaphore *syncsem,
int i, rc;
timespec_t toVal;
Channel *cP;
bool doProcess;

// Indicate to the starting thread that all went well
//
Expand All @@ -196,14 +195,12 @@ void XrdSys::IOEvents::PollPort::Begin(XrdSysSemaphore *syncsem,
abort();
}
}
doProcess = false;
for (i = 0; i < (int)numpolled; i++)
if (pollTab[i].portev_source == PORT_SOURCE_FD)
{if ((cP = (Channel *)pollTab[i].portev_user))
Dispatch(cP, pollTab[i].portev_events);
else doProcess = true;
}
if (doProcess && !Process()) return;
else if (!Process()) return;
}
} while(1);
}

Expand Down Expand Up @@ -331,22 +328,14 @@ bool XrdSys::IOEvents::PollPort::Modify(XrdSys::IOEvents::Channel *cP,

bool XrdSys::IOEvents::PollPort::Process()
{
int tmo = 0;

// Get the pipe request and check out actions of interest.
//

do{if (GetRequest())
{ if (reqBuff.req == PipeData::Post) reqBuff.theSem->Post();
else if (reqBuff.req == PipeData::Wait){reqBuff.theSem->Post();
tmo = -1;
}
else if (reqBuff.req == PipeData::Cont) break;
else if (reqBuff.req == PipeData::Stop){reqBuff.theSem->Post();
return false;
}
}
} while(tmo);
if (GetRequest())
if (reqBuff.req == PipeData::Post) reqBuff.theSem->Post();
{if (reqBuff.req == PipeData::Stop){reqBuff.theSem->Post();
return false;
}
}

// Associate the pipe again and return true
//
Expand Down

0 comments on commit dc56cad

Please sign in to comment.