File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1590,7 +1590,7 @@ bool Connection::signalIfIdle() {
15901590}
15911591
15921592void Connection::setPriority (Connection::Priority priority) {
1593- Connection::priority = priority;
1593+ Connection::priority. store ( priority) ;
15941594 switch (priority) {
15951595 case Priority::High:
15961596 max_reqs_per_event =
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ class Connection : public dcp_message_producers {
194194 void setAuthenticated (bool authenticated);
195195
196196 Priority getPriority () const {
197- return priority;
197+ return priority. load () ;
198198 }
199199
200200 void setPriority (const Priority priority);
@@ -1115,8 +1115,12 @@ class Connection : public dcp_message_producers {
11151115 /* * Name of the local socket if known */
11161116 const std::string sockname;
11171117
1118- /* * The connections priority */
1119- Priority priority{Priority::Medium};
1118+ /* *
1119+ * The connections' priority.
1120+ * atomic to allow read (from DCP stats) without acquiring any
1121+ * additional locks (priority should rarely change).
1122+ */
1123+ std::atomic<Priority> priority{Priority::Medium};
11201124
11211125 /* * The cluster map revision used by this client */
11221126 int clustermap_revno{-2 };
You can’t perform that action at this time.
0 commit comments