diff --git a/thread_pool.cpp b/thread_pool.cpp index 1925ada..16defae 100644 --- a/thread_pool.cpp +++ b/thread_pool.cpp @@ -400,18 +400,10 @@ ThreadPool::ThreadPool() { ThreadPoolContext *context = memnew(ThreadPoolContext); context->running = true; -#if VERSION_MAJOR < 4 - context->semaphore = Semaphore::create(); -#else context->semaphore = memnew(Semaphore); -#endif -#if VERSION_MAJOR < 4 - context->thread = Thread::create(ThreadPool::_worker_thread_func, context); -#else context->thread = memnew(Thread()); context->thread->start(ThreadPool::_worker_thread_func, context); -#endif _threads.write[i] = context; } @@ -431,11 +423,7 @@ ThreadPool::~ThreadPool() { for (int i = 0; i < _threads.size(); ++i) { ThreadPoolContext *context = _threads.get(i); -#if VERSION_MAJOR < 4 - Thread::wait_to_finish(context->thread); -#else context->thread->wait_to_finish(); -#endif memdelete(context->thread); memdelete(context->semaphore);