carb::LoadHookFn

Defined in carb/Framework.h

using carb::LoadHookFn = void (*)(const PluginDesc &plugin, void *userData)

Load Hook function.

Called when a plugin is loaded for the first time and the requested interface becomes available. The interface must be acquired with Framework::tryAcquireInterface() or Framework::acquireInterface() etc.

The thread that first acquires the interface will call all load hooks for that interface before the interface value is returned from the Framework. All other threads that acquire that interface will wait until load hooks have been called. Calling load hooks is done without an internal Framework mutex locked, so other threads are able to acquire other interfaces while load hooks are executing.

It is safe for a LoadHookFn to call Framework::removeLoadHook() for the handle that caused it to be called, or any other handle.

See also

Framework::addLoadHook() Framework::removeLoadHook()

Param plugin

The PluginDesc for the plugin that has now loaded.

Param userData

The void* that was passed to Framework::addLoadHook().