From 2c8de414e51305fa00ef6efdab69de0fbda7aff1 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Thu, 17 Mar 2016 14:08:38 -0700 Subject: [PATCH] Remove pthread_yield support 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 | 3 --- folly/configure.ac | 9 ++------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/folly/Portability.h b/folly/Portability.h index 3df79c9a..b1aa36e5 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -35,9 +35,6 @@ #if FOLLY_HAVE_SCHED_H #include - #ifndef FOLLY_HAVE_PTHREAD_YIELD - #define pthread_yield sched_yield - #endif #endif // Unaligned loads and stores diff --git a/folly/configure.ac b/folly/configure.ac index 89368066..bc725e23 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -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])) -- 2.34.1