Make sure that the lifecycle thread is terminated and all memory is
cleaned up on shutdown.
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
void RGWLC::stop_processor()
{
+ down_flag.set(1);
if (worker) {
worker->stop();
worker->join();
bool RGWLC::going_down()
{
- return false;
+ return (down_flag.read() != 0);
}
bool RGWLC::LCWorker::should_work(utime_t& now)
RGWRados *store;
int max_objs;
string *obj_names;
+ atomic_t down_flag;
class LCWorker : public Thread {
CephContext *cct;
delete gc;
gc = NULL;
+ if (use_lc_thread) {
+ lc->stop_processor();
+ }
+ delete lc;
+ lc = NULL;
+
delete obj_expirer;
obj_expirer = NULL;