summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2015-04-21 13:32:45 +0200
committerOndrej Kozina <okozina@redhat.com>2015-05-07 15:50:29 +0200
commitcd7f09b8a3b365cd444f55688f475c92bef36707 (patch)
tree226ac6aefc9a4420be09b0976d7f31899e34b166
parent5711c6c6676151826c68eea3a54288344a82595f (diff)
downloadlvm2-cd7f09b8a3b365cd444f55688f475c92bef36707.tar.gz
lvmpolld: optimize shutdown a bit
-rw-r--r--daemons/lvmpolld/lvmpolld-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c
index 4c1977fb5..a42888fbf 100644
--- a/daemons/lvmpolld/lvmpolld-core.c
+++ b/daemons/lvmpolld/lvmpolld-core.c
@@ -164,13 +164,15 @@ static int fini(struct daemon_state *s)
DEBUGLOG(s, "waiting for background threads to finish");
- do {
- nanosleep(&t, NULL);
+ while(1) {
lvmpolld_stores_lock(ls);
done = !pdst_locked_get_active_count(ls->id_to_pdlv_poll) &&
!pdst_locked_get_active_count(ls->id_to_pdlv_abort);
lvmpolld_stores_unlock(ls);
- } while (!done);
+ if (done)
+ break;
+ nanosleep(&t, NULL);
+ }
DEBUGLOG(s, "destroying internal data structures");