Signed-off-by: Casey Bodley <cbodley@redhat.com>
}
const int num_retries = 10;
-const int default_reshard_sleep_duration = 5;
+static const std::chrono::seconds default_reshard_sleep_duration(5);
int RGWReshardWait::do_wait()
{
- Mutex::Locker l(lock);
+ std::unique_lock lock(mutex);
- cond.WaitInterval(lock, utime_t(default_reshard_sleep_duration, 0));
+ cond.wait_for(lock, default_reshard_sleep_duration);
if (going_down) {
return -ECANCELED;
void stop_processor();
};
-
class RGWReshardWait {
RGWRados *store;
- Mutex lock{"RGWReshardWait::lock"};
- Cond cond;
+ ceph::mutex mutex = ceph::make_mutex("RGWReshardWait::lock");
+ ceph::condition_variable cond;
bool going_down{false};
const RGWBucketInfo& bucket_info);
void stop() {
- Mutex::Locker l(lock);
+ std::scoped_lock lock(mutex);
going_down = true;
- cond.SignalAll();
+ cond.notify_all();
}
};