File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1590,7 +1590,7 @@ bool Connection::signalIfIdle() {
1590
1590
}
1591
1591
1592
1592
void Connection::setPriority (Connection::Priority priority) {
1593
- Connection::priority = priority;
1593
+ Connection::priority. store ( priority) ;
1594
1594
switch (priority) {
1595
1595
case Priority::High:
1596
1596
max_reqs_per_event =
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ class Connection : public dcp_message_producers {
194
194
void setAuthenticated (bool authenticated);
195
195
196
196
Priority getPriority () const {
197
- return priority;
197
+ return priority. load () ;
198
198
}
199
199
200
200
void setPriority (const Priority priority);
@@ -1115,8 +1115,12 @@ class Connection : public dcp_message_producers {
1115
1115
/* * Name of the local socket if known */
1116
1116
const std::string sockname;
1117
1117
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};
1120
1124
1121
1125
/* * The cluster map revision used by this client */
1122
1126
int clustermap_revno{-2 };
You can’t perform that action at this time.
0 commit comments