-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5688 from npoltorapavlo/DELIA-66118-persistentstore
DELIA-66118: PersistentStore improvements
- Loading branch information
Showing
6 changed files
with
157 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#pragma once | ||
|
||
#include "../../Module.h" | ||
|
||
class WorkerPoolImplementation | ||
: public WPEFramework::Core::WorkerPool, | ||
public WPEFramework::Core::ThreadPool::ICallback { | ||
private: | ||
class Dispatcher : public WPEFramework::Core::ThreadPool::IDispatcher { | ||
public: | ||
Dispatcher(const Dispatcher&) = delete; | ||
Dispatcher& operator=(const Dispatcher&) = delete; | ||
Dispatcher() = default; | ||
~Dispatcher() override = default; | ||
|
||
private: | ||
void Initialize() override | ||
{ | ||
} | ||
void Deinitialize() override | ||
{ | ||
} | ||
void Dispatch(WPEFramework::Core::IDispatch* job) override | ||
{ | ||
job->Dispatch(); | ||
} | ||
}; | ||
|
||
public: | ||
WorkerPoolImplementation() = delete; | ||
WorkerPoolImplementation(const WorkerPoolImplementation&) = delete; | ||
WorkerPoolImplementation& operator=(const WorkerPoolImplementation&) = delete; | ||
WorkerPoolImplementation(const uint32_t stackSize) | ||
: WPEFramework::Core::WorkerPool(4 /*threadCount*/, stackSize, 32 /*queueSize*/, &_dispatch, this) | ||
, _dispatch() | ||
{ | ||
Run(); | ||
} | ||
~WorkerPoolImplementation() override | ||
{ | ||
Stop(); | ||
} | ||
void Idle() override | ||
{ | ||
} | ||
|
||
private: | ||
Dispatcher _dispatch; | ||
}; |