From 990d2346c447e5f72aa1c874d50ed9f16ab6c6cb Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 16 Mar 2020 13:37:46 -0700 Subject: [PATCH] ircd::m::fetch: Fix context and object destructions; minor cleanup. --- matrix/fetch.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/matrix/fetch.cc b/matrix/fetch.cc index c7f20fc8c..cd7894efc 100644 --- a/matrix/fetch.cc +++ b/matrix/fetch.cc @@ -81,11 +81,8 @@ ircd::m::fetch::backfill_limit_default { "default", 96L }, }; -decltype(ircd::m::fetch::request_context) -ircd::m::fetch::request_context -{ - "m.fetch.req", 1_MiB, &request_worker, context::POST -}; +decltype(ircd::m::fetch::dock) +ircd::m::fetch::dock; decltype(ircd::m::fetch::requests) ircd::m::fetch::requests; @@ -93,8 +90,14 @@ ircd::m::fetch::requests; decltype(ircd::m::fetch::requests_mutex) ircd::m::fetch::requests_mutex; -decltype(ircd::m::fetch::dock) -ircd::m::fetch::dock; +decltype(ircd::m::fetch::request_context) +ircd::m::fetch::request_context +{ + "m.fetch.req", + 1_MiB, + &request_worker, + context::POST +}; // // init @@ -102,6 +105,7 @@ ircd::m::fetch::dock; ircd::m::fetch::init::init() { + assert(requests.empty()); } ircd::m::fetch::init::~init() @@ -110,7 +114,6 @@ noexcept request_context.terminate(); request_context.join(); requests.clear(); - assert(requests.empty()); }