Set minimum sleep time to 10ms to avoid potential race where the thread wakes back up immediately after being put on sleep queue. This can probably be reduced to about 2ms, but this just seemed safer for now (DanL suggested 10ms).

This commit is contained in:
dnotestein 2013-12-06 00:22:06 -05:00
parent e1e3a7361b
commit 35077ea231
2 changed files with 2 additions and 2 deletions

View file

@ -178,7 +178,7 @@ namespace fc {
void thread::sleep_until( const time_point& tp ) {
//ilog( "sleep until ${tp} wait: ${delta}", ("tp",tp)("delta",(tp-fc::time_point::now()).count()) );
if( tp <= (time_point::now()+fc::microseconds(500)) )
if( tp <= (time_point::now()+fc::microseconds(10000)) )
{
this->yield(true);
}

View file

@ -447,7 +447,7 @@ namespace fc {
void yield_until( const time_point& tp, bool reschedule ) {
check_fiber_exceptions();
if( tp <= (time_point::now()+fc::microseconds(500)) )
if( tp <= (time_point::now()+fc::microseconds(10000)) )
{
return;
}