aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/workthreadpool.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-03-22 13:50:08 +0100
committerGitHub <[email protected]>2022-03-22 13:50:08 +0100
commit8667509907b8829b5148ee856dce675001051b01 (patch)
tree0252caa7cd01c533809b1b17dfa41721a0cccb82 /zenhttp/workthreadpool.h
parentRemove unused TotalAttachmentsSize (Mac warning) (diff)
downloadzen-8667509907b8829b5148ee856dce675001051b01.tar.xz
zen-8667509907b8829b5148ee856dce675001051b01.zip
move workthreadpool to zencore (#63)
Diffstat (limited to 'zenhttp/workthreadpool.h')
-rw-r--r--zenhttp/workthreadpool.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/zenhttp/workthreadpool.h b/zenhttp/workthreadpool.h
deleted file mode 100644
index 834339d50..000000000
--- a/zenhttp/workthreadpool.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-#pragma once
-
-#include <zencore/zencore.h>
-
-#include <zencore/blockingqueue.h>
-#include <zencore/refcount.h>
-
-#include <exception>
-#include <functional>
-#include <system_error>
-#include <thread>
-#include <vector>
-
-namespace zen {
-
-struct IWork : public RefCounted
-{
- virtual void Execute() = 0;
-
- inline std::exception_ptr GetException() { return m_Exception; }
-
-private:
- std::exception_ptr m_Exception;
-
- friend class WorkerThreadPool;
-};
-
-class WorkerThreadPool
-{
-public:
- WorkerThreadPool(int InThreadCount);
- ~WorkerThreadPool();
-
- void ScheduleWork(Ref<IWork> Work);
- void ScheduleWork(std::function<void()>&& Work);
-
- void WorkerThreadFunction();
-
-private:
- std::vector<std::thread> m_WorkerThreads;
- BlockingQueue<Ref<IWork>> m_WorkQueue;
-};
-
-} // namespace zen