#if wxUSE_THREADS
-// Windows headers define it
-#ifdef Yield
- #undef Yield
-#endif
-
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// 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);
// get the number of system CPUs - useful with SetConcurrency()
return m_internal->Post();
}
+// ----------------------------------------------------------------------------
+// wxThread
+// ----------------------------------------------------------------------------
+
+#ifndef __WXMAC__
+
+#include "wx/utils.h"
+
+void wxThread::Sleep(unsigned long milliseconds)
+{
+ wxMilliSleep(milliseconds);
+}
+
+#endif // __WXMAC__
/**
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);
::Sleep(0);
}
-void wxThread::Sleep(unsigned long milliseconds)
-{
- ::Sleep(milliseconds);
-}
-
int wxThread::GetCPUCount()
{
SYSTEM_INFO si;
::DosSleep(0);
}
-void wxThread::Sleep(
- unsigned long ulMilliseconds
-)
-{
- ::DosSleep(ulMilliseconds);
-}
-
int wxThread::GetCPUCount()
{
ULONG CPUCount;
{
}
-void wxThread::Sleep(unsigned long milliseconds)
-{
-}
-
int wxThread::GetCPUCount()
{
return 1;
#endif
}
-void wxThread::Sleep(unsigned long milliseconds)
-{
- wxMilliSleep(milliseconds);
-}
-
int wxThread::GetCPUCount()
{
#if defined(_SC_NPROCESSORS_ONLN)