]> git.saurik.com Git - wxWidgets.git/commitdiff
wxThread::Sleep() is the same as wxMilliSleep() on all platforms but Mac (and maybe...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 12 Apr 2008 02:28:46 +0000 (02:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 12 Apr 2008 02:28:46 +0000 (02:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/thread.h
include/wx/thrimpl.cpp
interface/thread.h
src/msw/thread.cpp
src/os2/thread.cpp
src/palmos/thread.cpp
src/unix/threadpsx.cpp

index e7dcf882acb9571aa61efe4ecf47f4504840da69..3c3493c3bebc5be5df3967e82ea130f2598f33f8 100644 (file)
 
 #if wxUSE_THREADS
 
-// Windows headers define it
-#ifdef Yield
-    #undef Yield
-#endif
-
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -452,7 +447,7 @@ public:
 
         // 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()
index 63b837fec65bd81f447a778eeb3e32a113d4364e..b9773620a9827ee18dc7a6295a23b0ae0a42b5af 100644 (file)
@@ -336,3 +336,17 @@ wxSemaError wxSemaphore::Post()
     return m_internal->Post();
 }
 
+// ----------------------------------------------------------------------------
+// wxThread
+// ----------------------------------------------------------------------------
+
+#ifndef __WXMAC__
+
+#include "wx/utils.h"
+
+void wxThread::Sleep(unsigned long milliseconds)
+{
+    wxMilliSleep(milliseconds);
+}
+
+#endif // __WXMAC__
index c7eca68d19c64fee0d5dc91fa0245d4d83cb1694..5f07abb5ed93fc0b65287d62be16e8a06d309540 100644 (file)
@@ -593,8 +593,8 @@ public:
 
     /**
         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);
 
index 942a0379daf71c5f586bd7ce83157e7473617f8b..301144ac1445c8c39d1c7bd7b9ea2fd0d68495e9 100644 (file)
@@ -916,11 +916,6 @@ void wxThread::Yield()
     ::Sleep(0);
 }
 
-void wxThread::Sleep(unsigned long milliseconds)
-{
-    ::Sleep(milliseconds);
-}
-
 int wxThread::GetCPUCount()
 {
     SYSTEM_INFO si;
index 253fb2143acf8192672efa69af29b135ca0b81bc..f0b8e6068e537e7b8aee83eaf93c1a0fd604dc0c 100644 (file)
@@ -569,13 +569,6 @@ void wxThread::Yield()
     ::DosSleep(0);
 }
 
-void wxThread::Sleep(
-  unsigned long                     ulMilliseconds
-)
-{
-    ::DosSleep(ulMilliseconds);
-}
-
 int wxThread::GetCPUCount()
 {
     ULONG CPUCount;
index cd2e55d310dbcaa4e253b252a358c0e45f8f2da0..6dbe22bb95808bf0651f5759e1d7d370b5487ac7 100644 (file)
@@ -412,10 +412,6 @@ void wxThread::Yield()
 {
 }
 
-void wxThread::Sleep(unsigned long milliseconds)
-{
-}
-
 int wxThread::GetCPUCount()
 {
     return 1;
index 8e7d9bba9fd26fe9748bc2dad00a067a2519914a..29288623cd431366f2dee4cc5ea766d872575e21 100644 (file)
@@ -1050,11 +1050,6 @@ void wxThread::Yield()
 #endif
 }
 
-void wxThread::Sleep(unsigned long milliseconds)
-{
-    wxMilliSleep(milliseconds);
-}
-
 int wxThread::GetCPUCount()
 {
 #if defined(_SC_NPROCESSORS_ONLN)