Made step to remove ASyncWindow in favour of usage of Future and FutureWatcher.
This should allow concurrency in the plugins to be independent from their container. Contains also some work on the system for registering plugins.
This commit is contained in:
parent
a54a063c13
commit
15bee33076
25 changed files with 327 additions and 52 deletions
29
pglab/plugin_support/PluginRegister.cpp
Normal file
29
pglab/plugin_support/PluginRegister.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "PluginRegister.h"
|
||||
#include "plugin_support/PluginModule.h"
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
PluginRegister* PluginRegister::s_pluginRegister;
|
||||
|
||||
PluginRegister* PluginRegister::getInstance()
|
||||
{
|
||||
static std::mutex m;
|
||||
// check if set without locking first (in most cases it will be set and it will never be unset) so locking the mutex everytime
|
||||
// is a waist of time.
|
||||
if (!s_pluginRegister) {
|
||||
// not set then lock
|
||||
std::lock_guard<std::mutex> guard(m);
|
||||
// recheck in case someone else just set it
|
||||
if (!s_pluginRegister) {
|
||||
s_pluginRegister = new PluginRegister;
|
||||
}
|
||||
}
|
||||
return s_pluginRegister;
|
||||
}
|
||||
|
||||
PluginRegister::PluginRegister() = default;
|
||||
|
||||
void PluginRegister::registerModule(PluginModuleSPtr module)
|
||||
{
|
||||
qDebug() << "Register called for " << module->identifier();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue