re PR libstdc++/33578 (__gnu_parallel::yield means what?)
authorDanny Smith <dannysmith@users.sourceforge.net>
Wed, 10 Oct 2007 23:39:30 +0000 (23:39 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Wed, 10 Oct 2007 23:39:30 +0000 (23:39 +0000)
PR libstdc++/33578
* include/parallel/compatibility.h.  Use POSIX sched_yield on
__CYGWIN__
(Sleep): Add prototype for __MINGW32__.

From-SVN: r129219

libstdc++-v3/ChangeLog
libstdc++-v3/include/parallel/compatibility.h

index 3b4e0286b73bf3d40904ac730574451c44db0449..cce3db17a065628dfed430eee1baaac02701fd75 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-11  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       PR libstdc++/33578
+       * include/parallel/compatibility.h.  Use POSIX sched_yield on
+       __CYGWIN__ 
+       (Sleep): Add prototype for __MINGW32__.
+
 2007-10-10  Jason Merrill  <jason@redhat.com>
 
        * libsupc++/guard.cc (struct mutex_wrapper): Move into
index ec0c05318856afd0aaa16dbd63e032437cdc6b23..cf8e318aa5ccbb75d9541a36bcba43516ddfd491 100644 (file)
@@ -45,7 +45,7 @@
 #include <sys/atomic.h>
 #endif
 
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined (__CYGWIN__)
 #include <sched.h>
 #endif
 
 #undef min
 #endif
 
+#ifdef __MINGW32__
+// Including <windows.h> will drag in all the windows32 names.  Since
+// that can cause user code portability problems, we just declare the
+// one needed function here.
+extern "C"
+__attribute((dllimport)) void __attribute__((stdcall)) Sleep (unsigned long);
+#endif
+
 namespace __gnu_parallel
 {
 #if defined(__ICC)
@@ -327,7 +335,7 @@ namespace __gnu_parallel
   inline void
   yield()
   {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (__CYGWIN__)
     Sleep(0);
 #else
     sched_yield();