#include <folly/Range.h>
#include <folly/Traits.h>
+#include <folly/portability/Config.h>
#include <folly/portability/PThread.h>
namespace folly {
template <typename T>
inline bool setThreadName(T /* id */, StringPiece /* name */) {
static_assert(
+#if FOLLY_HAVE_PTHREAD
std::is_same<T, pthread_t>::value ||
- std::is_same<T, std::thread::id>::value ||
- std::is_same<T, std::thread::native_handle_type>::value,
+#endif
+ std::is_same<T, std::thread::id>::value ||
+ std::is_same<T, std::thread::native_handle_type>::value,
"type must be pthread_t, std::thread::id or "
"std::thread::native_handle_type");
return false;
}
#endif
+#if FOLLY_HAVE_PTHREAD
template <
typename = folly::_t<std::enable_if<
std::is_same<pthread_t, std::thread::native_handle_type>::value>>>
inline bool setThreadName(StringPiece name) {
return setThreadName(pthread_self(), name);
}
+#else
+inline bool setThreadName(StringPiece name) {
+ return false;
+}
+#endif
}
AC_DEFINE([HAVE_LINUX_VDSO], [1], [Define to 1 if liblinux-vdso is available])
fi
+AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if pthread is avaliable])
+
AC_CACHE_CHECK(
[for usable std::is_trivially_copyable],
[folly_cv_decl_std_is_trivially_copyable],