From cccc4450ce36f171270c0993e4cb58921c65dda8 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Wed, 10 Oct 2007 23:39:30 +0000 Subject: [PATCH] re PR libstdc++/33578 (__gnu_parallel::yield means what?) PR libstdc++/33578 * include/parallel/compatibility.h. Use POSIX sched_yield on __CYGWIN__ (Sleep): Add prototype for __MINGW32__. From-SVN: r129219 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/parallel/compatibility.h | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3b4e0286b73..cce3db17a06 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2007-10-11 Danny Smith + + PR libstdc++/33578 + * include/parallel/compatibility.h. Use POSIX sched_yield on + __CYGWIN__ + (Sleep): Add prototype for __MINGW32__. + 2007-10-10 Jason Merrill * libsupc++/guard.cc (struct mutex_wrapper): Move into diff --git a/libstdc++-v3/include/parallel/compatibility.h b/libstdc++-v3/include/parallel/compatibility.h index ec0c0531885..cf8e318aa5c 100644 --- a/libstdc++-v3/include/parallel/compatibility.h +++ b/libstdc++-v3/include/parallel/compatibility.h @@ -45,7 +45,7 @@ #include #endif -#if !defined(_WIN32) +#if !defined(_WIN32) || defined (__CYGWIN__) #include #endif @@ -56,6 +56,14 @@ #undef min #endif +#ifdef __MINGW32__ +// Including 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();