Commit 52dcff2e authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Support newer versions of boost in the portable PThread implementation

Summary: Newer versions of boost thread re-wrote how this works, so use the new way.

Reviewed By: yfeldblum

Differential Revision: D19824658

fbshipit-source-id: a3d66fd6ef781ac83c92f6313cf47a7920cfebda
parent d99292ef
......@@ -17,10 +17,13 @@
#include <folly/portability/PThread.h>
#if !FOLLY_HAVE_PTHREAD && defined(_WIN32)
#include <boost/thread/exceptions.hpp> // @manual
#include <boost/thread/tss.hpp> // @manual
#include <boost/version.hpp> // @manual
#include <errno.h>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <exception>
......@@ -683,7 +686,12 @@ int pthread_setspecific(pthread_key_t key, const void* value) {
// function, which we don't want to do.
boost::detail::set_tss_data(
realKey,
#if BOOST_VERSION >= 107000
boost::detail::thread::cleanup_caller_t(),
boost::detail::thread::cleanup_func_t(),
#else
boost::shared_ptr<boost::detail::tss_cleanup_function>(),
#endif
const_cast<void*>(value),
false);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment