feat(plugin): add CAbi.h v1, CModuleHost quiesce/reload/pins, and unlocked PluginManager staging

This commit is contained in:
faumaray committed 2026-11-26 16:16:29 +03:00
1 parent 1474a69ab1
commit a24e086e47
16 files changed
+3961 -164

No files matched your search

+7 -5
View File
@@ -215,18 +215,20 @@ namespace Void::Plugin
std::filesystem::path path;
std::atomic<std::shared_ptr<detail::Instance>> current;
bool watched{false};
std::mutex reload_mutex;
};
Entry* find(std::string_view name) const;
std::expected<void, LoadError>
reload_locked(Entry& entry, std::string_view name,
const std::filesystem::path& sourcePath);
std::shared_ptr<Entry> find_shared(std::string_view name) const;
std::expected<void, LoadError> reload_entry_unlocked(
const std::shared_ptr<Entry>& entry, std::string_view name,
const std::optional<std::filesystem::path>& newPath);
std::vector<std::function<void(std::string_view)>>
reload_callbacks_locked() const;
Options m_options;
mutable std::mutex m_mutex; // guards the registry map + reloads
std::unordered_map<std::string, std::unique_ptr<Entry>> m_plugins;
mutable std::mutex m_mutex; // guards the registry map & observer list
std::unordered_map<std::string, std::shared_ptr<Entry>> m_plugins;
std::vector<std::pair<ReloadCallbackId,
std::function<void(std::string_view)>>>
m_on_reloaded;