summaryrefslogtreecommitdiff
path: root/lib/worker.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-20 15:00:02 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-20 15:00:02 +0000
commitfe38b38725d9d639f0e09f444e746c0bf2f8dc10 (patch)
tree2d3e185f41c71d064f7c805c080600bf29e0aa93 /lib/worker.cpp
parentRemove unused worker from main (diff)
downloadilt-fe38b38725d9d639f0e09f444e746c0bf2f8dc10.tar.bz2
ilt-fe38b38725d9d639f0e09f444e746c0bf2f8dc10.tar.xz
ilt-fe38b38725d9d639f0e09f444e746c0bf2f8dc10.zip
Add a non-threaded worker
Runs work immediately for when compiler doesn't support C++20 semaphore
Diffstat (limited to 'lib/worker.cpp')
-rw-r--r--lib/worker.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/worker.cpp b/lib/worker.cpp
index 3c12caa..fd255c7 100644
--- a/lib/worker.cpp
+++ b/lib/worker.cpp
@@ -1,8 +1,9 @@
#include "worker.h"
-#include "work.h"
-#include <algorithm>
-#include <iterator>
-#include <mutex>
+#if __cpp_lib_semaphore
+# include "work.h"
+# include <algorithm>
+# include <iterator>
+# include <mutex>
Worker::Worker() : todoLen {0}
{
@@ -44,3 +45,4 @@ Worker::worker()
j->doWork();
}
}
+#endif