[libcxx] r223661 - Explicitly include <sched.h> for sched_yield()

Sergey Dmitrouk sdmitrouk at accesssoftek.com
Mon Dec 8 06:50:21 PST 2014


Author: sdmitrouk
Date: Mon Dec  8 08:50:21 2014
New Revision: 223661

URL: http://llvm.org/viewvc/llvm-project?rev=223661&view=rev
Log:
Explicitly include <sched.h> for sched_yield()

It might be implicitly included by <pthread.h> (and that's why it worked
so far), but it's not guaranteed (for example, this is not the case with
newlib).

Modified:
    libcxx/trunk/include/mutex
    libcxx/trunk/include/thread

Modified: libcxx/trunk/include/mutex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=223661&r1=223660&r2=223661&view=diff
==============================================================================
--- libcxx/trunk/include/mutex (original)
+++ libcxx/trunk/include/mutex Mon Dec  8 08:50:21 2014
@@ -178,6 +178,7 @@ template<class Callable, class ...Args>
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 #include <tuple>
 #endif
+#include <sched.h>
 
 #include <__undef_min_max>
 

Modified: libcxx/trunk/include/thread
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=223661&r1=223660&r2=223661&view=diff
==============================================================================
--- libcxx/trunk/include/thread (original)
+++ libcxx/trunk/include/thread Mon Dec  8 08:50:21 2014
@@ -99,6 +99,7 @@ void sleep_for(const chrono::duration<Re
 #include <tuple>
 #endif
 #include <pthread.h>
+#include <sched.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header





More information about the cfe-commits mailing list