diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2018-12-13 11:44:21 -0500 |
---|---|---|
committer | Henrik Edin <henrik.edin@mongodb.com> | 2018-12-18 09:12:51 -0500 |
commit | c28cb6852fca219d6f0262000c378e982b7ca9ff (patch) | |
tree | e06e74d1729e644db7c4dc2e5ecd529145b2f34c /src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp | |
parent | 05ebfef11161b96ba0e8374f34c359a403097f60 (diff) | |
download | mongo-c28cb6852fca219d6f0262000c378e982b7ca9ff.tar.gz |
SERVER-38458 Upgrade boost to version 1.69
Diffstat (limited to 'src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp')
-rw-r--r-- | src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp b/src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp new file mode 100644 index 00000000000..c1ff0f92398 --- /dev/null +++ b/src/third_party/boost-1.69.0/boost/thread/pthread/pthread_helpers.hpp @@ -0,0 +1,42 @@ +#ifndef BOOST_THREAD_PTHREAD_PTHREAD_HELPERS_HPP +#define BOOST_THREAD_PTHREAD_PTHREAD_HELPERS_HPP +// Copyright (C) 2017 +// Vicente J. Botet Escriba +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include <boost/thread/detail/config.hpp> +#include <pthread.h> + +#include <boost/config/abi_prefix.hpp> + +namespace boost +{ + namespace pthread + { + inline int cond_init(pthread_cond_t& cond) { + + #ifdef BOOST_THREAD_INTERNAL_CLOCK_IS_MONO + pthread_condattr_t attr; + int res = pthread_condattr_init(&attr); + if (res) + { + return res; + } + pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + res=pthread_cond_init(&cond,&attr); + pthread_condattr_destroy(&attr); + return res; + #else + return pthread_cond_init(&cond,NULL); + #endif + + } + } +} + +#include <boost/config/abi_suffix.hpp> + +#endif |