From: Christopher Dykes <cdykes@fb.com>
Date: Sun, 26 Feb 2017 19:13:26 +0000 (-0800)
Subject: Drop FOLLY_HAVE_STD_THIS_THREAD_SLEEP_FOR
X-Git-Tag: v2017.03.06.00~20
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba35fe5ddc1c75ad16195763ecf126eaa8a78f18;p=folly.git

Drop FOLLY_HAVE_STD_THIS_THREAD_SLEEP_FOR

Summary: It was only needed for GCC 4.7 support. GCC 4.8 and above support it.

Reviewed By: yfeldblum

Differential Revision: D4616044

fbshipit-source-id: 177d7b3b7090134f9d8084a3ba7a984446c87d5e
---

diff --git a/folly/configure.ac b/folly/configure.ac
index c73da686..623bfdae 100644
--- a/folly/configure.ac
+++ b/folly/configure.ac
@@ -252,22 +252,6 @@ AC_DEFINE_UNQUOTED(
   [OVERRIDE], [$override_val],
   [Define to "override" if the compiler supports C++11 "override"])
 
-AC_CACHE_CHECK(
-  [for std::this_thread::sleep_for],
-  [folly_cv_func_this_thread_sleep_for],
-  [AC_COMPILE_IFELSE(
-    [AC_LANG_SOURCE[
-      #include <thread>
-      #include <chrono>
-      void func() { std::this_thread::sleep_for(std::chrono::seconds(1)); }]],
-    [folly_cv_func_this_thread_sleep_for=yes],
-    [folly_cv_func_this_thread_sleep_for=no])])
-
-if test "$folly_cv_func_this_thread_sleep_for" = yes; then
-    AC_DEFINE([HAVE_STD__THIS_THREAD__SLEEP_FOR], [1],
-              [Define to 1 if std::this_thread::sleep_for() is defined.])
-fi
-
 AC_CACHE_CHECK(
   [for constexpr strlen],
   [folly_cv_func_constexpr_strlen],
diff --git a/folly/test/ThreadLocalTest.cpp b/folly/test/ThreadLocalTest.cpp
index 52fef3f8..c33549d0 100644
--- a/folly/test/ThreadLocalTest.cpp
+++ b/folly/test/ThreadLocalTest.cpp
@@ -415,7 +415,6 @@ class FillObject {
 
 }  // namespace
 
-#if FOLLY_HAVE_STD_THIS_THREAD_SLEEP_FOR
 TEST(ThreadLocal, Stress) {
   static constexpr size_t numFillObjects = 250;
   std::array<ThreadLocalPtr<FillObject>, numFillObjects> objects;
@@ -446,7 +445,6 @@ TEST(ThreadLocal, Stress) {
 
   EXPECT_EQ(numFillObjects * numThreads * numReps, gDestroyed);
 }
-#endif
 
 // Yes, threads and fork don't mix
 // (http://cppwisdom.quora.com/Why-threads-and-fork-dont-mix) but if you're