summaryrefslogtreecommitdiffstats
path: root/filedistribution
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-09-14 20:51:26 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-09-14 20:51:26 +0000
commit4cd6b80379fbc47fa734a3a5ed0302c409868970 (patch)
tree6ec7c26eae1a17ccabec975273caf6db3e01d9be /filedistribution
parentf468daee61d5a9fe6f05b1957b0c962f795380eb (diff)
Better naming, explicit capture, and clear close.
Diffstat (limited to 'filedistribution')
-rw-r--r--filedistribution/src/tests/lib/mock-zookeeper.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/filedistribution/src/tests/lib/mock-zookeeper.cpp b/filedistribution/src/tests/lib/mock-zookeeper.cpp
index f3cdd568e1e..4d39e41786a 100644
--- a/filedistribution/src/tests/lib/mock-zookeeper.cpp
+++ b/filedistribution/src/tests/lib/mock-zookeeper.cpp
@@ -58,7 +58,7 @@ struct Node {
std::shared_ptr<Node> sharedRoot;
-void wakeUp() { }
+void doNothing() { }
struct ZHandle {
struct Worker {
@@ -96,12 +96,14 @@ struct ZHandle {
~ZHandle() {
std::for_each(ephemeralNodes.begin(), ephemeralNodes.end(),
- [&] (const string & s) { zoo_delete((zhandle_t*)this, s.c_str(), 0); });
-
- _closed.store(true);
- watcherInvocations.push(std::ref(wakeUp));
+ [this] (const string & s) { zoo_delete((zhandle_t*)this, s.c_str(), 0); });
+ close();
_watchersThread.join();
}
+ void close() {
+ _closed.store(true);
+ watcherInvocations.push(std::ref(doNothing));
+ }
};
void