diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-10-15 18:08:41 +0200 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-10-22 11:01:41 +0200 |
commit | 755c6833ae2d2eee87e80ed3b84c75e968f48c46 (patch) | |
tree | 653345beb889acabc83b3b3b03e849fa34b1baac /libtransport/src/hicn/transport/protocols/protocol.h | |
parent | 7204bac00804448a797d4e76ced04a3b84d0d741 (diff) |
[HICN-328] Reworking setSocketOption and getSocketOption to be thread-safe
Change-Id: Ie22572822b9ac1e6c300fd7982035c799546bd76
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/protocols/protocol.h')
-rw-r--r-- | libtransport/src/hicn/transport/protocols/protocol.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/protocols/protocol.h b/libtransport/src/hicn/transport/protocols/protocol.h index 88889bb8c..e4821b6a0 100644 --- a/libtransport/src/hicn/transport/protocols/protocol.h +++ b/libtransport/src/hicn/transport/protocols/protocol.h @@ -15,6 +15,8 @@ #pragma once +#include <atomic> + #include <hicn/transport/interfaces/socket.h> #include <hicn/transport/protocols/packet_manager.h> #include <hicn/transport/protocols/statistics.h> @@ -60,7 +62,9 @@ class TransportProtocol : public interface::BasePortal::ConsumerCallback, protected: interface::ConsumerSocket *socket_; std::shared_ptr<interface::BasePortal> portal_; - volatile bool is_running_; + std::atomic<bool> is_running_; + // True if it si the first time we schedule an interest + std::atomic<bool> is_first_; TransportStatistics stats_; }; |