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
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()
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()