Allocator Aware Array and List

This commit is contained in:
Dynamitos
2021-10-23 00:22:35 +02:00
parent 451572f254
commit 9c48c48f8c
16 changed files with 1390 additions and 1230 deletions
+16 -3
View File
@@ -2,7 +2,11 @@
using namespace Seele;
static ThreadPool gThreadPool;
void Event::await_suspend(std::coroutine_handle<JobPromise> h)
{
getGlobalThreadPool().addJob(Job(h));
}
Job JobPromise::get_return_object() noexcept {
return Job { std::coroutine_handle<JobPromise>::from_promise(*this) };
@@ -14,7 +18,16 @@ ThreadPool::ThreadPool(uint32 threadCount)
}
static ThreadPool& getGlobalThreadPool()
ThreadPool::~ThreadPool()
{
return gThreadPool;
for(auto& thread : workers)
{
thread.join();
}
}
ThreadPool& Seele::getGlobalThreadPool()
{
static ThreadPool threadPool;
return threadPool;
}