diff --git a/components/net/cpp/include/ftl/net/peer.hpp b/components/net/cpp/include/ftl/net/peer.hpp index 45747174719d858bfbe1d77999cf610903d379de..9978da92202d5b457109a195d688421ac350634c 100644 --- a/components/net/cpp/include/ftl/net/peer.hpp +++ b/components/net/cpp/include/ftl/net/peer.hpp @@ -266,7 +266,7 @@ class Peer { //std::vector<std::function<void(Peer &)>> close_handlers_; std::map<int, std::unique_ptr<virtual_caller>> callbacks_; - static int rpcid__; // Return ID for RPC calls + static volatile int rpcid__; // Return ID for RPC calls }; // --- Inline Template Implementations ----------------------------------------- @@ -361,7 +361,7 @@ int Peer::asyncCall( std::function<void(const T&)> cb, ARGS... args) { auto args_obj = std::make_tuple(args...); - auto rpcid = 0; + uint32_t rpcid = 0; { // Could this be the problem???? diff --git a/components/net/cpp/src/peer.cpp b/components/net/cpp/src/peer.cpp index 0335ca67f3a284294b4973c83aea62100d56a5c2..8f280bad46ef512449cc0fa40876e9c13f059434 100644 --- a/components/net/cpp/src/peer.cpp +++ b/components/net/cpp/src/peer.cpp @@ -59,7 +59,7 @@ using std::vector; return ss.str(); }*/ -int Peer::rpcid__ = 0; +volatile int Peer::rpcid__ = 0; // Global peer UUID ftl::UUID ftl::net::this_peer; @@ -548,7 +548,6 @@ void Peer::_dispatchResponse(uint32_t id, msgpack::object &res) { // TODO: Handle error reporting... UNIQUE_LOCK(cb_mtx_,lk); if (callbacks_.count(id) > 0) { - //DLOG(1) << "Received return RPC value"; // Allow for unlock before callback auto cb = std::move(callbacks_[id]);