Skip to content

Commit d2cdef8

Browse files
committed
add some logs
1 parent 33c30c3 commit d2cdef8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xmake/core/base/private/async_task.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ function async_task._loop(event, queue, mutex, is_stopped, is_diagnosis)
8181
local thread = require("base/thread")
8282

8383
local function dprint(...)
84+
-- TODO
85+
is_diagnosis = true
8486
if is_diagnosis then
8587
print(...)
8688
end
@@ -188,8 +190,8 @@ function async_task._start()
188190
end
189191
os.atexit(function (errors)
190192
if task_thread then
191-
utils.dprint("async_task: wait the pending tasks(%d) for exiting ..", task_queue:size())
192193
is_stopped = true
194+
193195
-- Perhaps the thread hasn't started yet.
194196
-- Let's wait a while and let it finish executing the tasks in the current queue.
195197
task_mutex:lock()
@@ -201,6 +203,8 @@ function async_task._start()
201203
end
202204
task_is_stopped:set(true)
203205
task_event:post()
206+
207+
utils.dprint("async_task: wait the pending tasks(%d) for exiting ..", task_queue:size())
204208
task_thread:wait(-1)
205209
utils.dprint("async_task: wait finished")
206210
end

0 commit comments

Comments
 (0)