From 34ab0451bdd1e7496d607acb6ee209586ee7e86e Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 29 Aug 2018 22:51:58 +0200 Subject: Rename job.{cpp,h} to scheduler --- job.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 job.h (limited to 'job.h') diff --git a/job.h b/job.h deleted file mode 100644 index 95da7c7..0000000 --- a/job.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -using namespace std; - - -class Scheduler { - struct Job { - function callback; - - Job(const function callback) - : callback(callback) {} - }; - - queue jobs; - bool finishFlag = false; - mutex commMut; - - bool hasJoined = false; - - vector workers; - - void workerEntry(); - -public: - const int nthreads; - - Scheduler(int nthreads); - ~Scheduler(); - - // func is run in child thread - void submit(const function &func); - - void finish(); -}; -- cgit v1.2.3-70-g09d2