X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Ftest%2Ftest_stress_watch.cc;h=8604328b59c2bd49b56c58f0323de6f6a9e9ed1e;hb=31f18b776d001752a193a7cec8bb49033c1a904c;hp=ff964df17ed30ff20e944bc523bd8811765ce82d;hpb=40152f1e46a80b3405e5558a442ee632198dfd24;p=ceph.git diff --git a/ceph/src/test/test_stress_watch.cc b/ceph/src/test/test_stress_watch.cc index ff964df17..8604328b5 100644 --- a/ceph/src/test/test_stress_watch.cc +++ b/ceph/src/test/test_stress_watch.cc @@ -1,6 +1,5 @@ #include "include/rados/librados.h" #include "include/rados/librados.hpp" -#include "include/atomic.h" #include "include/utime.h" #include "common/Thread.h" #include "common/Clock.h" @@ -13,6 +12,7 @@ #include #include #include +#include #include "test/librados/TestCase.h" @@ -23,7 +23,7 @@ using std::ostringstream; using std::string; static sem_t *sem; -static atomic_t stop_flag; +static std::atomic stop_flag = { false }; class WatchNotifyTestCtx : public WatchCtx { @@ -45,7 +45,7 @@ struct WatcherUnwatcher : public Thread { void *entry() override { Rados cluster; connect_cluster_pp(cluster); - while (!stop_flag.read()) { + while (!stop_flag) { IoCtx ioctx; cluster.ioctx_create(pool.c_str(), ioctx); @@ -113,7 +113,7 @@ TEST_P(WatchStress, Stress1) { ioctx.unwatch("foo", handle); ioctx.close(); } - stop_flag.set(1); + stop_flag = true; thr->join(); nioctx.close(); ASSERT_EQ(0, destroy_one_pool_pp(pool_name, ncluster));