Add workqueue system
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "DeviceManager.h"
|
||||
#include "logid.h"
|
||||
#include "InputDevice.h"
|
||||
#include "util/workqueue.h"
|
||||
|
||||
#define LOGID_VIRTUAL_INPUT_NAME "LogiOps Virtual Input"
|
||||
#define DEFAULT_CONFIG_FILE "/etc/logid.cfg"
|
||||
@@ -42,6 +43,7 @@ LogLevel logid::global_loglevel = INFO;
|
||||
std::shared_ptr<Configuration> logid::global_config;
|
||||
std::unique_ptr<DeviceManager> logid::device_manager;
|
||||
std::unique_ptr<InputDevice> logid::virtual_input;
|
||||
std::unique_ptr<workqueue> logid::global_workqueue;
|
||||
|
||||
bool logid::kill_logid = false;
|
||||
std::mutex logid::device_manager_reload;
|
||||
@@ -155,6 +157,8 @@ Possible options are:
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
global_workqueue = std::make_unique<workqueue>(LOGID_DEFAULT_WORKER_COUNT);
|
||||
|
||||
readCliOptions(argc, argv);
|
||||
|
||||
// Read config
|
||||
@@ -165,6 +169,8 @@ int main(int argc, char** argv)
|
||||
global_config = std::make_shared<Configuration>();
|
||||
}
|
||||
|
||||
global_workqueue->setThreadCount(global_config->workerCount());
|
||||
|
||||
//Create a virtual input device
|
||||
try {
|
||||
virtual_input = std::make_unique<InputDevice>(LOGID_VIRTUAL_INPUT_NAME);
|
||||
|
||||
Reference in New Issue
Block a user