Remove pthread_yield support
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 17 Mar 2016 21:08:38 +0000 (14:08 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 17 Mar 2016 21:20:23 +0000 (14:20 -0700)
Summary:[Folly] Remove `pthread_yield` support.

* It is not actually part of POSIX - rather, `sched_yield` is.
* In C++, we should be using `std::this_thread::yield` anyway.

Reviewed By: Gownta

Differential Revision: D3056221

fb-gh-sync-id: 2fea55dd7b715149327987d61e5a573ad0455330
shipit-source-id: 2fea55dd7b715149327987d61e5a573ad0455330

folly/Portability.h
folly/configure.ac

index 3df79c9a3755f427486cf4323d84749219837a58..b1aa36e5d9181cac3e72ec96b6e328edad16852e 100644 (file)
@@ -35,9 +35,6 @@
 
 #if FOLLY_HAVE_SCHED_H
  #include <sched.h>
- #ifndef FOLLY_HAVE_PTHREAD_YIELD
-  #define pthread_yield sched_yield
- #endif
 #endif
 
 // Unaligned loads and stores
index 893680667b3398c7803c93648c4fac7ab918f79e..bc725e23098bb224a2558c31a73540fc97a0ef37 100644 (file)
@@ -121,7 +121,7 @@ AM_PATH_PYTHON
 
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h features.h inttypes.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h mutex.h malloc.h byteswap.h bits/functexcept.h bits/c++config.h])
+AC_CHECK_HEADERS([fcntl.h features.h inttypes.h limits.h sched.h stdint.h stdlib.h string.h sys/time.h unistd.h mutex.h malloc.h byteswap.h bits/functexcept.h bits/c++config.h])
 
 AC_CHECK_HEADER(double-conversion/double-conversion.h, [], [AC_MSG_ERROR(
                 [Couldn't find double-conversion.h, please download from \
@@ -474,17 +474,12 @@ AC_CHECK_FUNCS([getdelim \
                 memset \
                 pow \
                 strerror \
-                pthread_yield \
+                sched_yield \
                 malloc_size \
                 malloc_usable_size \
                 memrchr \
                 pipe2])
 
-if test "$ac_cv_func_pthread_yield" = "no"; then
-   AC_CHECK_HEADERS([sched.h])
-   AC_CHECK_FUNCS([sched_yield])
-fi
-
 AC_CHECK_HEADER([lz4.h], AC_CHECK_LIB([lz4], [LZ4_decompress_safe]))
 AC_CHECK_HEADER([snappy.h], AC_CHECK_LIB([snappy], [main]))
 AC_CHECK_HEADER([zlib.h], AC_CHECK_LIB([z], [main]))