diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-05-06 08:58:34 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-05-06 08:58:34 +0200 |
commit | 07f61b1ad6363cd471b7dab3f94c3160636fd6a0 (patch) | |
tree | e196fb1623435d1806c37f94068f4ed8bebe3394 /src/network.h | |
parent | ff0930c8d488eed7087fd3224ac34049ad88dbcf (diff) |
Server: do not return reference to self identity
Diffstat (limited to 'src/network.h')
-rw-r--r-- | src/network.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network.h b/src/network.h index c620cf6..5a656cb 100644 --- a/src/network.h +++ b/src/network.h @@ -6,6 +6,7 @@ #include <condition_variable> #include <mutex> +#include <shared_mutex> #include <thread> #include <vector> @@ -15,6 +16,8 @@ using std::condition_variable; using std::monostate; using std::mutex; using std::optional; +using std::shared_lock; +using std::shared_mutex; using std::shared_ptr; using std::string; using std::thread; @@ -162,8 +165,9 @@ struct Server::Priv condition_variable announceCondvar; bool finish = false; + shared_mutex selfMutex; Identity self; - Bhv<LocalState> localState; + const Bhv<LocalState> localState; thread threadListen; thread threadAnnounce; |