much better
This commit is contained in:
parent
5329e551d4
commit
692a1b7915
2 changed files with 23 additions and 12 deletions
|
|
@ -24,7 +24,6 @@
|
|||
#include <mutex>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <condition_variable>
|
||||
#include <future>
|
||||
|
||||
#include "fixedQueue.h"
|
||||
|
|
@ -45,12 +44,12 @@ struct DivPendingTask {
|
|||
struct DivWorkThread {
|
||||
DivWorkPool* parent;
|
||||
std::mutex lock;
|
||||
std::mutex selfLock;
|
||||
std::thread* thread;
|
||||
std::condition_variable notify;
|
||||
std::promise<void> notify;
|
||||
FixedQueue<DivPendingTask,32> tasks;
|
||||
std::atomic<bool> isBusy;
|
||||
bool terminate;
|
||||
bool promiseAlreadySet;
|
||||
|
||||
void run();
|
||||
bool assign(const std::function<void(void*)>& what, void* arg);
|
||||
|
|
@ -62,7 +61,8 @@ struct DivWorkThread {
|
|||
DivWorkThread():
|
||||
parent(NULL),
|
||||
isBusy(false),
|
||||
terminate(false) {}
|
||||
terminate(false),
|
||||
promiseAlreadySet(false) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue