Add workqueue system

This commit is contained in:
pixl
2020-07-10 03:16:51 -04:00
parent 02d361b541
commit 1f3fa53721
15 changed files with 529 additions and 15 deletions

View File

@@ -18,7 +18,7 @@
#include "ToggleHiresScroll.h"
#include "../Device.h"
#include "../util/log.h"
#include "../util/thread.h"
#include "../util/task.h"
#include "../backend/hidpp20/features/ReprogControls.h"
using namespace logid::actions;
@@ -40,7 +40,7 @@ void ToggleHiresScroll::press()
_pressed = true;
if(_hires_scroll)
{
thread::spawn([hires=this->_hires_scroll](){
task::spawn([hires=this->_hires_scroll](){
auto mode = hires->getMode();
mode ^= backend::hidpp20::HiresScroll::HiRes;
hires->setMode(mode);

View File

@@ -18,7 +18,7 @@
#include "ToggleSmartShift.h"
#include "../Device.h"
#include "../backend/hidpp20/features/ReprogControls.h"
#include "../util/thread.h"
#include "../util/task.h"
using namespace logid::actions;
using namespace logid::backend;
@@ -39,7 +39,7 @@ void ToggleSmartShift::press()
_pressed = true;
if(_smartshift)
{
thread::spawn([ss=this->_smartshift](){
task::spawn([ss=this->_smartshift](){
auto status = ss->getStatus();
status.setActive = true;
status.active = !status.active;