Commit b501c326 authored by Joseph Noir's avatar Joseph Noir

Rebase to develop branch

parent 2bc98de4
#include <iostream> #include <iostream>
#include <chrono>
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/chrono.hpp"
#include "caf/io/all.hpp" #include "caf/io/all.hpp"
using std::cout; using std::cout;
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
* This example illustrates how to do time-triggered loops in libcaf. * * This example illustrates how to do time-triggered loops in libcaf. *
\ ******************************************************************************/ \ ******************************************************************************/
#include <chrono>
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/chrono.hpp"
using std::cout; using std::cout;
using std::endl; using std::endl;
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <chrono>
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/chrono.hpp"
using std::cout; using std::cout;
using std::cerr; using std::cerr;
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
#define CAF_CACHE_LINE_SIZE 64 #define CAF_CACHE_LINE_SIZE 64
#include <chrono>
#include <atomic> #include <atomic>
#include <cassert> #include <cassert>
#include "caf/thread.hpp" #include "caf/thread.hpp"
#include "caf/chrono.hpp"
namespace caf { namespace caf {
namespace detail { namespace detail {
......
...@@ -85,7 +85,7 @@ class singletons { ...@@ -85,7 +85,7 @@ class singletons {
static void stop_singletons(); static void stop_singletons();
private: private:
static mutex& get_mutex(); static mutex& get_plugin_mutex();
static std::atomic<abstract_singleton*>& get_plugin_singleton(size_t id); static std::atomic<abstract_singleton*>& get_plugin_singleton(size_t id);
...@@ -94,7 +94,7 @@ class singletons { ...@@ -94,7 +94,7 @@ class singletons {
static T* lazy_get(std::atomic<T*>& ptr, mutex& mtx, Factory f) { static T* lazy_get(std::atomic<T*>& ptr, mutex& mtx, Factory f) {
auto result = ptr.load(std::memory_order_acquire); auto result = ptr.load(std::memory_order_acquire);
if (result == nullptr) { if (result == nullptr) {
lock_guard<mutex> guard(get_mutex()); lock_guard<mutex> guard(get_plugin_mutex());
result = ptr.load(std::memory_order_relaxed); result = ptr.load(std::memory_order_relaxed);
if (result == nullptr) { if (result == nullptr) {
result = f(); result = f();
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
#include <stack> #include <stack>
#include <atomic> #include <atomic>
#include <chrono>
#include <iostream> #include <iostream>
#include <functional> #include <functional>
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/chrono.hpp"
using namespace std; using namespace std;
using namespace caf; using namespace caf;
......
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