diff options
| author | ruki <[email protected]> | 2025-11-06 22:38:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-07 15:01:57 +0800 |
| commit | 7a9f4ecfcb3c493ebd54f3d5686e8da2bdbe9862 (patch) | |
| tree | d23cefbdf9643e401247766f1b1d695f6f8ea93e | |
| parent | 7fd1695a1a7fda5d66f878e6e34f7fd121e152c8 (diff) | |
add some logs
| -rw-r--r-- | xmake/core/base/private/async_task.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/private/async_task.lua b/xmake/core/base/private/async_task.lua index 7b8219e24..ee0f76a7b 100644 --- a/xmake/core/base/private/async_task.lua +++ b/xmake/core/base/private/async_task.lua @@ -81,6 +81,8 @@ function async_task._loop(event, queue, mutex, is_stopped, is_diagnosis) local thread = require("base/thread") local function dprint(...) + -- TODO + is_diagnosis = true if is_diagnosis then print(...) end @@ -188,8 +190,8 @@ function async_task._start() end os.atexit(function (errors) if task_thread then - utils.dprint("async_task: wait the pending tasks(%d) for exiting ..", task_queue:size()) is_stopped = true + -- Perhaps the thread hasn't started yet. -- Let's wait a while and let it finish executing the tasks in the current queue. task_mutex:lock() @@ -201,6 +203,8 @@ function async_task._start() end task_is_stopped:set(true) task_event:post() + + utils.dprint("async_task: wait the pending tasks(%d) for exiting ..", task_queue:size()) task_thread:wait(-1) utils.dprint("async_task: wait finished") end |
