Applied patch [ 584057 ] Fixes calculation bug in wxThread::Sleep

There's a problem in src/mac/thread.cpp function
wxThread::Sleep when CLOCKS_PER_SEC is not
1000. The amount-to-sleep code doesn't take into
account this value. Due to this when I did Sleep(1000) it
was sleeping a fraction of a second because on my Mac
CLOCKS_PER_SEC is 60. This patch fixes it.

Dimitri Schoolwerth (dimitrishortcut)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2002-08-08 10:04:13 +00:00
parent a57a1fb7e0
commit 7f19fc8cae
2 changed files with 10 additions and 10 deletions

View File

@ -523,11 +523,11 @@ void wxThread::Yield()
void wxThread::Sleep(unsigned long milliseconds)
{
clock_t start = clock() ;
do
{
YieldToAnyThread() ;
} while( clock() - start < milliseconds / CLOCKS_PER_SEC ) ;
clock_t start = clock();
do
{
YieldToAnyThread();
} while( clock() - start < (milliseconds * CLOCKS_PER_SEC) / 1000 ) ;
}
int wxThread::GetCPUCount()

View File

@ -523,11 +523,11 @@ void wxThread::Yield()
void wxThread::Sleep(unsigned long milliseconds)
{
clock_t start = clock() ;
do
{
YieldToAnyThread() ;
} while( clock() - start < milliseconds / CLOCKS_PER_SEC ) ;
clock_t start = clock();
do
{
YieldToAnyThread();
} while( clock() - start < (milliseconds * CLOCKS_PER_SEC) / 1000 ) ;
}
int wxThread::GetCPUCount()