Commit 8a3069a4 authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable

parents 71e33889 755c7721
......@@ -54,7 +54,7 @@ class buffer {
if (recv_result == 0) {
// connection closed
if (throw_on_error) {
std::ios_base::failure("cannot read from a closed pipe/socket");
throw std::ios_base::failure("cannot read from a closed pipe/socket");
}
return false;
}
......
......@@ -31,6 +31,7 @@
#ifndef MATCHES_HPP
#define MATCHES_HPP
#include <numeric>
#include "cppa/pattern.hpp"
#include "cppa/any_tuple.hpp"
......
......@@ -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>
......
......@@ -31,6 +31,7 @@
#ifndef TYPE_TO_PTYPE_HPP
#define TYPE_TO_PTYPE_HPP
#include <string>
#include <cstdint>
#include <type_traits>
......
......@@ -42,10 +42,11 @@
#ifdef CPPA_DISABLE_CONTEXT_SWITCHING
namespace cppa { namespace util {
struct fiber {
class fiber {
public:
inline static void swap(fiber&, fiber&) { }
};
} }
} } // namespace cppa::util
#elif defined(CPPA_USE_UCONTEXT_IMPL)
......
......@@ -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