aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-07-18 20:45:28 +0800
committerfanquake <fanquake@gmail.com>2019-07-18 21:06:01 +0800
commit3f76160087c04ce29fd4a4b08838107a25a540a9 (patch)
treed4290022de4f5b8643617d89e6f140d0bd2410ee
parent410774ab89fd8aa70773ff44aa1e7a8d7c7c2cad (diff)
parentb2711b98bdc0dc220500a4b3ca94dfb97c4d17f2 (diff)
downloadbitcoin-3f76160087c04ce29fd4a4b08838107a25a540a9.tar.xz
Merge #16406: 0.18: fix: tor: Call event_base_loopbreak from the event's callback
b2711b98bdc0dc220500a4b3ca94dfb97c4d17f2 fix: tor: Call event_base_loopbreak from the event's callback (João Barbosa) Pull request description: Github-Pull: #16405 Rebased-From: a981e749e6553487cd48eda28e590f769e81c85c ACKs for top commit: laanwj: ACK b2711b98bdc0dc220500a4b3ca94dfb97c4d17f2, code change is the same as for master fanquake: ACK b2711b98bdc0dc220500a4b3ca94dfb97c4d17f2 Tree-SHA512: 9f225e505c0241be422ed897f56aef6ebad57e15d3bfe5154c7fe4f874df342e0df287871cd737eb777d0f45865a6d129cd5d1a4c036ea0a4e5d4f36520ab174
-rw-r--r--src/torcontrol.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index 550e23b222..b56be26897 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -759,7 +759,9 @@ void InterruptTorControl()
{
if (gBase) {
LogPrintf("tor: Thread interrupt\n");
- event_base_loopbreak(gBase);
+ event_base_once(gBase, -1, EV_TIMEOUT, [](evutil_socket_t, short, void*) {
+ event_base_loopbreak(gBase);
+ }, nullptr, nullptr);
}
}