Made cCondWait::SleepMs() sleep at least 3ms to avoid a possible busy wait

This commit is contained in:
Klaus Schmidinger
2005-01-14 14:08:47 +01:00
parent 0d596d0478
commit 0ad4b2a713
5 changed files with 10 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: thread.c 1.40 2004/12/19 10:43:14 kls Exp $
* $Id: thread.c 1.41 2005/01/14 13:59:48 kls Exp $
*/
#include "thread.h"
@@ -36,7 +36,7 @@ cCondWait::~cCondWait()
void cCondWait::SleepMs(int TimeoutMs)
{
cCondWait w;
w.Wait(TimeoutMs);
w.Wait(max(TimeoutMs, 3)); // making sure the time is >2ms to avoid a possible busy wait
}
bool cCondWait::Wait(int TimeoutMs)