Skip to content

Commit 02e162c

Browse files
committed
C++20 use std::memory_order<type>
the values in std::memory_order is no longer available Change-Id: Ic0423cc0bc3314047b7085dbcf801eb06251590e Reviewed-on: https://review.couchbase.org/c/kv_engine/+/189931 Tested-by: Build Bot <[email protected]> Reviewed-by: James H <[email protected]>
1 parent 6b0cc34 commit 02e162c

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

daemon/connection.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ void Connection::updatePrivilegeContext() {
270270
subject_to_metering.store(
271271
privilegeContext.check(cb::rbac::Privilege::Unmetered, {}, {})
272272
.failed(),
273-
std::memory_order::memory_order_release);
273+
std::memory_order_release);
274274
subject_to_throttling.store(
275275
privilegeContext.check(cb::rbac::Privilege::Unthrottled, {}, {})
276276
.failed(),
277-
std::memory_order::memory_order_release);
277+
std::memory_order_release);
278278
node_supervisor.store(
279279
privilegeContext.check(cb::rbac::Privilege::NodeSupervisor, {}, {})
280280
.success(),
281-
std::memory_order::memory_order_release);
281+
std::memory_order_release);
282282
}
283283

284284
cb::engine_errc Connection::dropPrivilege(cb::rbac::Privilege privilege) {

daemon/connection.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,7 @@ class Connection : public ConnectionIface,
817817
}
818818

819819
bool isSubjectToMetering() const {
820-
return subject_to_metering.load(
821-
std::memory_order::memory_order_acquire);
820+
return subject_to_metering.load(std::memory_order_acquire);
822821
}
823822

824823
/// Is this connection not to be throttled?
@@ -827,25 +826,22 @@ class Connection : public ConnectionIface,
827826
}
828827

829828
bool isSubjectToThrottling() const {
830-
return subject_to_throttling.load(
831-
std::memory_order::memory_order_acquire);
829+
return subject_to_throttling.load(std::memory_order_acquire);
832830
}
833831

834832
bool isNodeSupervisor() const {
835-
return node_supervisor.load(std::memory_order::memory_order_acquire);
833+
return node_supervisor.load(std::memory_order_acquire);
836834
}
837835

838836
/// Clear the DCP throttle for this connection to allow it to progress
839837
void resumeThrottledDcpStream();
840838

841839
bool isNonBlockingThrottlingMode() const {
842-
return non_blocking_throttling_mode.load(
843-
std::memory_order::memory_order_acquire);
840+
return non_blocking_throttling_mode.load(std::memory_order_acquire);
844841
}
845842

846843
void setNonBlockingThrottlingMode(bool enable) {
847-
non_blocking_throttling_mode.store(enable,
848-
std::memory_order::memory_order_release);
844+
non_blocking_throttling_mode.store(enable, std::memory_order_release);
849845
}
850846

851847
/**

daemon/stats.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ struct stats {
167167
std::atomic<unsigned int> curr_conns;
168168

169169
size_t getCurrConnections() const {
170-
return curr_conns.load(std::memory_order::memory_order_consume);
170+
return curr_conns.load(std::memory_order_consume);
171171
}
172172

173173
/// The number of system connections
174174
std::atomic<unsigned int> system_conns;
175175

176176
size_t getSystemConnections() const {
177-
return system_conns.load(std::memory_order::memory_order_consume);
177+
return system_conns.load(std::memory_order_consume);
178178
}
179179

180180
size_t getUserConnections() const {

0 commit comments

Comments
 (0)