wxThread::Sleep() is the same as wxMilliSleep() on all platforms but Mac (and maybe it should be the same thing there as well)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,11 +22,6 @@
|
|||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
|
||||||
// Windows headers define it
|
|
||||||
#ifdef Yield
|
|
||||||
#undef Yield
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -452,7 +447,7 @@ public:
|
|||||||
|
|
||||||
// Sleep during the specified period of time in milliseconds
|
// Sleep during the specified period of time in milliseconds
|
||||||
//
|
//
|
||||||
// NB: at least under MSW worker threads can not call ::wxSleep()!
|
// This is the same as wxMilliSleep().
|
||||||
static void Sleep(unsigned long milliseconds);
|
static void Sleep(unsigned long milliseconds);
|
||||||
|
|
||||||
// get the number of system CPUs - useful with SetConcurrency()
|
// get the number of system CPUs - useful with SetConcurrency()
|
||||||
|
@@ -336,3 +336,17 @@ wxSemaError wxSemaphore::Post()
|
|||||||
return m_internal->Post();
|
return m_internal->Post();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxThread
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef __WXMAC__
|
||||||
|
|
||||||
|
#include "wx/utils.h"
|
||||||
|
|
||||||
|
void wxThread::Sleep(unsigned long milliseconds)
|
||||||
|
{
|
||||||
|
wxMilliSleep(milliseconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __WXMAC__
|
||||||
|
@@ -593,8 +593,8 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Pauses the thread execution for the given amount of time.
|
Pauses the thread execution for the given amount of time.
|
||||||
This function should be used instead of wxSleep() by all worker
|
|
||||||
threads (i.e. all except the main one).
|
This is the same as wxMilliSleep().
|
||||||
*/
|
*/
|
||||||
static void Sleep(unsigned long milliseconds);
|
static void Sleep(unsigned long milliseconds);
|
||||||
|
|
||||||
|
@@ -916,11 +916,6 @@ void wxThread::Yield()
|
|||||||
::Sleep(0);
|
::Sleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::Sleep(unsigned long milliseconds)
|
|
||||||
{
|
|
||||||
::Sleep(milliseconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxThread::GetCPUCount()
|
int wxThread::GetCPUCount()
|
||||||
{
|
{
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
|
@@ -569,13 +569,6 @@ void wxThread::Yield()
|
|||||||
::DosSleep(0);
|
::DosSleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::Sleep(
|
|
||||||
unsigned long ulMilliseconds
|
|
||||||
)
|
|
||||||
{
|
|
||||||
::DosSleep(ulMilliseconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxThread::GetCPUCount()
|
int wxThread::GetCPUCount()
|
||||||
{
|
{
|
||||||
ULONG CPUCount;
|
ULONG CPUCount;
|
||||||
|
@@ -412,10 +412,6 @@ void wxThread::Yield()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::Sleep(unsigned long milliseconds)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxThread::GetCPUCount()
|
int wxThread::GetCPUCount()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -1050,11 +1050,6 @@ void wxThread::Yield()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::Sleep(unsigned long milliseconds)
|
|
||||||
{
|
|
||||||
wxMilliSleep(milliseconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxThread::GetCPUCount()
|
int wxThread::GetCPUCount()
|
||||||
{
|
{
|
||||||
#if defined(_SC_NPROCESSORS_ONLN)
|
#if defined(_SC_NPROCESSORS_ONLN)
|
||||||
|
Reference in New Issue
Block a user