diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-09-14 21:03:23 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-09-14 21:03:23 +0000 |
commit | d2f95fe18f5d1455b1ad09c3224409680b3e4976 (patch) | |
tree | 50d79a6be7d1b4419f0fa05bb177cd69108b70af | |
parent | be80c07cc106f02e5be8453030557dbafb9e85ce (diff) |
areWDone
-rw-r--r-- | filedistribution/src/vespa/filedistribution/common/componentsdeleter.cpp | 9 | ||||
-rw-r--r-- | filedistribution/src/vespa/filedistribution/common/componentsdeleter.h | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.cpp b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.cpp index 0aa5eb6cc80..124ce5d0472 100644 --- a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.cpp +++ b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.cpp @@ -23,7 +23,7 @@ struct ComponentsDeleter::Worker { void ComponentsDeleter::Worker::operator()() { - while ( ! _parent.allComponentsDeleted() ) { + while ( ! _parent.areWeDone() ) { CallDeleteFun deleteFun = _parent._deleteRequests.pop(); deleteFun(); } @@ -46,15 +46,12 @@ ComponentsDeleter::waitForAllComponentsDeleted() { LOG(debug, "Waiting for all components to be deleted"); - for (int i=0; i<600 && !allComponentsDeleted(); ++i) { + for (int i=0; i<600 && !areWeDone(); ++i) { std::this_thread::sleep_for(100ms); } LOG(debug, "Done waiting for all components to be deleted"); logNotDeletedComponents(); - - if (!allComponentsDeleted()) - kill(getpid(), SIGKILL); } void @@ -68,7 +65,7 @@ ComponentsDeleter::close() } bool -ComponentsDeleter::allComponentsDeleted() +ComponentsDeleter::areWeDone() { LockGuard guard(_trackedComponentsMutex); return _closed && _trackedComponents.empty() && _deleteRequests.empty(); diff --git a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h index de92f041da7..277084e28b3 100644 --- a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h +++ b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h @@ -43,7 +43,7 @@ class ComponentsDeleter { } void waitForAllComponentsDeleted(); - bool allComponentsDeleted(); + bool areWeDone(); void logNotDeletedComponents(); void close(); public: |