Commit d208a59a authored by Joseph Noir's avatar Joseph Noir

Add more RIOT adjustments

parent 4ab7c4af
...@@ -70,7 +70,6 @@ set (LIBCAF_CORE_SRCS ...@@ -70,7 +70,6 @@ set (LIBCAF_CORE_SRCS
src/replies_to.cpp src/replies_to.cpp
src/resumable.cpp src/resumable.cpp
src/ripemd_160.cpp src/ripemd_160.cpp
src/run_program.cpp
src/scoped_actor.cpp src/scoped_actor.cpp
src/set_scheduler.cpp src/set_scheduler.cpp
src/serializer.cpp src/serializer.cpp
...@@ -84,6 +83,12 @@ set (LIBCAF_CORE_SRCS ...@@ -84,6 +83,12 @@ set (LIBCAF_CORE_SRCS
src/uniform_type_info.cpp src/uniform_type_info.cpp
src/uniform_type_info_map.cpp) src/uniform_type_info_map.cpp)
if (NOT CAF_FOR_RIOT)
set(LIBCAF_CORE_SRCS
${LIBCAF_CORE_SRCS}
src/run_program.cpp)
endif()
add_custom_target(libcaf_core) add_custom_target(libcaf_core)
# build shared library if not compiling static only # build shared library if not compiling static only
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#ifndef CAF_LOGGING_HPP #ifndef CAF_LOGGING_HPP
#define CAF_LOGGING_HPP #define CAF_LOGGING_HPP
#include <thread>
#include <cstring> #include <cstring>
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
...@@ -28,6 +27,7 @@ ...@@ -28,6 +27,7 @@
#include <unordered_map> #include <unordered_map>
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/thread.hpp"
#include "caf/to_string.hpp" #include "caf/to_string.hpp"
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
...@@ -97,7 +97,7 @@ class logging { ...@@ -97,7 +97,7 @@ class logging {
private: private:
detail::shared_spinlock m_aids_lock; detail::shared_spinlock m_aids_lock;
std::unordered_map<std::thread::id, actor_id> m_aids; std::unordered_map<thread::id, actor_id> m_aids;
}; };
struct oss_wr { struct oss_wr {
......
...@@ -484,7 +484,7 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) { ...@@ -484,7 +484,7 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
scheduler::inc_detached_threads(); scheduler::inc_detached_threads();
} }
//intrusive_ptr<local_actor> mself{this}; //intrusive_ptr<local_actor> mself{this};
std::thread([hide](intrusive_ptr<local_actor> mself) { thread([hide](intrusive_ptr<local_actor> mself) {
CAF_PUSH_AID(mself->id()); CAF_PUSH_AID(mself->id());
CAF_LOGF_TRACE(""); CAF_LOGF_TRACE("");
auto max_throughput = std::numeric_limits<size_t>::max(); auto max_throughput = std::numeric_limits<size_t>::max();
......
...@@ -197,7 +197,7 @@ logging* logging::create_singleton() { ...@@ -197,7 +197,7 @@ logging* logging::create_singleton() {
// returns the actor ID for the current thread // returns the actor ID for the current thread
actor_id logging::get_aid() { actor_id logging::get_aid() {
shared_lock<detail::shared_spinlock> guard{m_aids_lock}; shared_lock<detail::shared_spinlock> guard{m_aids_lock};
auto i = m_aids.find(std::this_thread::get_id()); auto i = m_aids.find(this_thread::get_id());
if (i != m_aids.end()) { if (i != m_aids.end()) {
return i->second; return i->second;
} }
...@@ -205,7 +205,7 @@ actor_id logging::get_aid() { ...@@ -205,7 +205,7 @@ actor_id logging::get_aid() {
} }
actor_id logging::set_aid(actor_id aid) { actor_id logging::set_aid(actor_id aid) {
auto tid = std::this_thread::get_id(); auto tid = this_thread::get_id();
upgrade_lock<detail::shared_spinlock> guard{m_aids_lock}; upgrade_lock<detail::shared_spinlock> guard{m_aids_lock};
auto i = m_aids.find(tid); auto i = m_aids.find(tid);
if (i != m_aids.end()) { if (i != m_aids.end()) {
......
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