mirror of
https://github.com/matrix-construct/construct
synced 2024-12-30 17:34:04 +01:00
ircd::mods: Add conf item for static dtor check; remove redundant debuglog.
This commit is contained in:
parent
69dcd7acd9
commit
3b967b6746
1 changed files with 9 additions and 12 deletions
21
ircd/mods.cc
21
ircd/mods.cc
|
@ -21,6 +21,7 @@ namespace ircd::mods
|
|||
static bool unload(mod &) noexcept;
|
||||
|
||||
extern conf::item<bool> mapi_check;
|
||||
extern conf::item<bool> unload_check;
|
||||
}
|
||||
|
||||
ircd::log::log
|
||||
|
@ -52,6 +53,13 @@ ircd::mods::mapi_check
|
|||
{ "default", true },
|
||||
};
|
||||
|
||||
decltype(ircd::mods::unload_check)
|
||||
ircd::mods::unload_check
|
||||
{
|
||||
{ "name", "ircd.mods.unload.check" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
decltype(ircd::mods::mod::loading)
|
||||
ircd::mods::mod::loading;
|
||||
|
||||
|
@ -135,7 +143,7 @@ noexcept
|
|||
children.size(),
|
||||
};
|
||||
|
||||
if(unlikely(!mapi::static_destruction))
|
||||
if(unlikely(!mapi::static_destruction && unload_check))
|
||||
{
|
||||
handle_stuck(mod);
|
||||
return false;
|
||||
|
@ -149,17 +157,6 @@ noexcept
|
|||
};
|
||||
|
||||
assert(!mod.handle.is_loaded());
|
||||
|
||||
log::debug
|
||||
{
|
||||
log, "Static unload for '%s' @ `%s' children:%zu loaded:%zu unloading:%zu attempting...",
|
||||
mod.name(),
|
||||
mod.location(),
|
||||
children.size(),
|
||||
mod.loaded.size(),
|
||||
std::distance(begin(mod.unloading), end(mod.unloading)),
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue