Skip to content

Commit

Permalink
[XrdCl] Use XrdSysTimer instead of sleep to avoid tight loops (interr…
Browse files Browse the repository at this point in the history
…upts)
  • Loading branch information
ljanyst committed Apr 22, 2013
1 parent 5a8c0c8 commit e1a7b8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/XrdCl/XrdClTaskManager.cc
Expand Up @@ -21,6 +21,7 @@
#include "XrdCl/XrdClUtils.hh"
#include "XrdCl/XrdClDefaultEnv.hh"
#include "XrdCl/XrdClConstants.hh"
#include "XrdSys/XrdSysTimer.hh"

#include <iostream>

Expand Down Expand Up @@ -240,7 +241,7 @@ namespace XrdCl
// Enable the cancelation and go to sleep
//------------------------------------------------------------------------
pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0 );
::sleep( pResolution );
XrdSysTimer::Wait( pResolution*1000 );
}
}
}
3 changes: 2 additions & 1 deletion src/XrdCl/XrdClThirdPartyCopyJob.cc
Expand Up @@ -26,6 +26,7 @@
#include "XrdCl/XrdClMonitor.hh"
#include "XrdOuc/XrdOucTPC.hh"
#include "XrdSys/XrdSysPthread.hh"
#include "XrdSys/XrdSysTimer.hh"
#include <iostream>
#include <cctype>
#include <sstream>
Expand Down Expand Up @@ -243,7 +244,7 @@ namespace XrdCl
//--------------------------------------------------------------------------
while( 1 )
{
sleep(1);
XrdSysTimer::Wait( 1000 );

if( progress )
{
Expand Down

0 comments on commit e1a7b8d

Please sign in to comment.