You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#pragma once
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
namespace iflytop { using namespace std;
class ZWorkQueue { private: bool m_isJoining = false;
unique_ptr<thread> m_workQue; queue<function<void()>> m_workQueue;
mutex m_QueueMutex; mutex m_mutex;
bool workFlag = false;
public: ZWorkQueue(); ~ZWorkQueue(); void startSchedule(); void stopSchedule();
bool isWorking() { return workFlag; } bool push(function<void()> work); };
} // namespace iflytop
|