Commit fd99fa95 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Fix rcu_domain move-assignment pointer copy

Summary: [Folly] Fix `rcu_domain` move-assignment pointer copy which seemingly should be a pointer exchange.

Reviewed By: magedm

Differential Revision: D9846892

fbshipit-source-id: ef3a113780af7456d66dacd376b3bf43670fcb9e
parent abf92b38
......@@ -399,7 +399,8 @@ class rcu_reader_domain {
: domain_(domain) {}
rcu_reader_domain(const rcu_reader_domain&) = delete;
rcu_reader_domain(rcu_reader_domain&& other) noexcept
: epoch_(std::move(other.epoch_)), domain_(std::move(other.domain_)) {}
: epoch_(std::move(other.epoch_)),
domain_(std::exchange(other.domain_, nullptr)) {}
rcu_reader_domain& operator=(const rcu_reader_domain&) = delete;
rcu_reader_domain& operator=(rcu_reader_domain&& other) noexcept {
if (epoch_.has_value()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment