Commit 94ee1624 authored by neverlord's avatar neverlord

use boost threads only for GCC < 4.7 on Mac OS

parent 1a2ba785
......@@ -31,7 +31,9 @@
#ifndef THREAD_HPP
#define THREAD_HPP
#ifdef __APPLE__
#if defined(__APPLE__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 7) && !defined(__clang__)
#define CPPA_USE_BOOST_THREADS
#include <boost/thread.hpp>
#include "cppa/util/duration.hpp"
......@@ -80,6 +82,8 @@ inline boost::system_time& operator+=(boost::system_time& lhs,
#else
#define CPPA_USE_STD_THREADS
#include <mutex>
#include <thread>
#include <condition_variable>
......
......@@ -90,7 +90,7 @@ struct thread_pool_scheduler::worker {
if (result) {
return result;
}
# ifdef __APPLE__
# ifdef CPPA_USE_BOOST_THREADS
auto timeout = boost::get_system_time();
timeout += boost::posix_time::milliseconds(1);
boost::this_thread::sleep(timeout);
......@@ -108,7 +108,7 @@ struct thread_pool_scheduler::worker {
if (result) {
return result;
}
# ifdef __APPLE__
# ifdef CPPA_USE_BOOST_THREADS
auto timeout = boost::get_system_time();
timeout += boost::posix_time::milliseconds(10);
boost::this_thread::sleep(timeout);
......
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