Fixes a CAS error in watcher.

Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2021-05-21 17:45:18 +08:00
parent ad4215511f
commit b28aca1f82
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ etcd::Watcher::~Watcher()
bool etcd::Watcher::Wait()
{
if (cancelled.exchange(true)) {
if (!cancelled.exchange(true)) {
if (task_.joinable()) {
task_.join();
}