Commit 838dec63 authored by Joseph Noir's avatar Joseph Noir

Fix namespace

Thread, mutex and condition_variable are offered through our
according namespaces in the caf namespace.
parent 699a74b5
...@@ -91,7 +91,7 @@ class singletons { ...@@ -91,7 +91,7 @@ class singletons {
// Get instance from @p ptr or crate it on-the-fly using DCLP // Get instance from @p ptr or crate it on-the-fly using DCLP
template <class T, class Factory> template <class T, class Factory>
static T* lazy_get(std::atomic<T*>& ptr, std::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_mutex());
...@@ -106,7 +106,7 @@ class singletons { ...@@ -106,7 +106,7 @@ class singletons {
} }
template <class T> template <class T>
static T* lazy_get(std::atomic<T*>& ptr, std::mutex& mtx) { static T* lazy_get(std::atomic<T*>& ptr, mutex& mtx) {
return lazy_get(ptr, mtx, [] { return T::create_singleton(); }); return lazy_get(ptr, mtx, [] { return T::create_singleton(); });
} }
......
...@@ -37,25 +37,25 @@ namespace detail { ...@@ -37,25 +37,25 @@ namespace detail {
namespace { namespace {
std::atomic<abstract_singleton*> s_plugins[singletons::max_plugins]; std::atomic<abstract_singleton*> s_plugins[singletons::max_plugins];
std::mutex s_plugins_mtx; mutex s_plugins_mtx;
std::atomic<scheduler::abstract_coordinator*> s_scheduling_coordinator; std::atomic<scheduler::abstract_coordinator*> s_scheduling_coordinator;
std::mutex s_scheduling_coordinator_mtx; mutex s_scheduling_coordinator_mtx;
std::atomic<uniform_type_info_map*> s_uniform_type_info_map; std::atomic<uniform_type_info_map*> s_uniform_type_info_map;
std::mutex s_uniform_type_info_map_mtx; mutex s_uniform_type_info_map_mtx;
std::atomic<actor_registry*> s_actor_registry; std::atomic<actor_registry*> s_actor_registry;
std::mutex s_actor_registry_mtx; mutex s_actor_registry_mtx;
std::atomic<group_manager*> s_group_manager; std::atomic<group_manager*> s_group_manager;
std::mutex s_group_manager_mtx; mutex s_group_manager_mtx;
std::atomic<node_id::data*> s_node_id; std::atomic<node_id::data*> s_node_id;
std::mutex s_node_id_mtx; mutex s_node_id_mtx;
std::atomic<logging*> s_logger; std::atomic<logging*> s_logger;
std::mutex s_logger_mtx; mutex s_logger_mtx;
} // namespace <anonymous> } // namespace <anonymous>
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
#define CAF_IO_NETWORK_MULTIPLEXER_HPP #define CAF_IO_NETWORK_MULTIPLEXER_HPP
#include <string> #include <string>
#include <thread>
#include <functional> #include <functional>
#include "caf/extend.hpp" #include "caf/extend.hpp"
#include "caf/thread.hpp"
#include "caf/make_counted.hpp" #include "caf/make_counted.hpp"
#include "caf/memory_managed.hpp" #include "caf/memory_managed.hpp"
...@@ -155,7 +155,7 @@ class multiplexer { ...@@ -155,7 +155,7 @@ class multiplexer {
*/ */
template <class F> template <class F>
void dispatch(F fun) { void dispatch(F fun) {
if (std::this_thread::get_id() == thread_id()) { if (this_thread::get_id() == thread_id()) {
fun(); fun();
return; return;
} }
...@@ -184,11 +184,11 @@ class multiplexer { ...@@ -184,11 +184,11 @@ class multiplexer {
*/ */
virtual boost::asio::io_service* pimpl(); virtual boost::asio::io_service* pimpl();
inline const std::thread::id& thread_id() const { inline const thread::id& thread_id() const {
return m_tid; return m_tid;
} }
inline void thread_id(std::thread::id tid) { inline void thread_id(thread::id tid) {
m_tid = std::move(tid); m_tid = std::move(tid);
} }
...@@ -201,7 +201,7 @@ class multiplexer { ...@@ -201,7 +201,7 @@ class multiplexer {
/** /**
* Must be set by the subclass. * Must be set by the subclass.
*/ */
std::thread::id m_tid; thread::id m_tid;
}; };
using multiplexer_ptr = std::unique_ptr<multiplexer>; using multiplexer_ptr = std::unique_ptr<multiplexer>;
......
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