mirror of
https://github.com/rayaman/multi.git
synced 2026-09-05 07:27:35 -04:00
Fixed > 1 which prevented tasks from being processed if only on task was in queue
This commit is contained in:
@@ -888,9 +888,10 @@ function multi:newTask(func)
|
|||||||
multi:newThread("Task Handler",function()
|
multi:newThread("Task Handler",function()
|
||||||
while true do
|
while true do
|
||||||
thread.hold(function()
|
thread.hold(function()
|
||||||
return _tasks > 1
|
return _tasks > 0
|
||||||
end)
|
end)
|
||||||
for i=1,_tasks do
|
for i=1,_tasks do
|
||||||
|
print("Doing tasks")
|
||||||
tasks[i]()
|
tasks[i]()
|
||||||
end
|
end
|
||||||
_tasks = 0
|
_tasks = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user