mirror of
https://github.com/Relintai/thread_pool.git
synced 2024-11-12 10:25:29 +01:00
When not using threading just return the head of the queue in get_running_job.
This commit is contained in:
parent
61fffea0a4
commit
c69a2a9db4
@ -132,6 +132,9 @@ void ThreadPool::cancel_task(Ref<ThreadPoolJob> job) {
|
||||
}
|
||||
|
||||
Ref<ThreadPoolJob> ThreadPool::get_running_job(const Variant &object, const StringName &method) {
|
||||
if (!_use_threads)
|
||||
return _queue[_current_queue_head];
|
||||
|
||||
for (int i = 0; i < _threads.size(); ++i) {
|
||||
Ref<ThreadPoolJob> j = _threads[i]->job;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user