mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 10:08:56 +02:00
ircd::mods: Improve various comments.
This commit is contained in:
parent
b59f571c94
commit
53071b2029
|
@ -136,7 +136,7 @@ try
|
|||
const auto ours{[]
|
||||
{
|
||||
// Immediately go back to their terminate so if our terminate
|
||||
// actually itself terminates it won't loop.
|
||||
// handler stack calls terminate it won't loop.
|
||||
std::set_terminate(their_terminate);
|
||||
log::critical
|
||||
{
|
||||
|
@ -145,7 +145,10 @@ try
|
|||
};
|
||||
}};
|
||||
|
||||
// Reference this instance at the top of the loading stack.
|
||||
// Reference this instance at the top of the loading stack. When this
|
||||
// scope unwinds the module is loaded and static initialization has
|
||||
// taken place; note that our user's init function is not executed
|
||||
// until later after mods::mod constructs.
|
||||
loading.emplace_front(this);
|
||||
const unwind pop_loading{[this]
|
||||
{
|
||||
|
|
12
ircd/mods.h
12
ircd/mods.h
|
@ -18,7 +18,17 @@ namespace ircd::mods
|
|||
void handle_ebadf(const string_view &what);
|
||||
}
|
||||
|
||||
/// Internal module representation
|
||||
/// Internal module representation. This object closely wraps the dlopen()
|
||||
/// handle and only one instance exists for a DSO when it's loaded. Loading
|
||||
/// and unloading of the module is represented by construction and destruction
|
||||
/// of this class, that involves static initialization and destruction of the
|
||||
/// the module's assets, but not invocation of our user's supplied init. The
|
||||
/// user's init is invoked after construction of this class which allows use of
|
||||
/// the shared_ptr semantics from within the init.
|
||||
///
|
||||
/// It is a critical error if static initialization and destruction is not
|
||||
/// congruent with the lifetime of this instance.
|
||||
///
|
||||
struct ircd::mods::mod
|
||||
:std::enable_shared_from_this<mod>
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue