diff options
| author | ruki <[email protected]> | 2025-11-05 00:55:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-07 15:01:57 +0800 |
| commit | 31d4f431d8267f3dfd52fae8184d09cc8c7f2529 (patch) | |
| tree | 48cb40e9bd74a9d1a384887e062c9cbb6f7cc011 /xmake/core/base/thread.lua | |
| parent | f897e99bfd0b4e9e70f6dfc80016e8fcdccda2b7 (diff) | |
fix thread exit
Diffstat (limited to 'xmake/core/base/thread.lua')
| -rw-r--r-- | xmake/core/base/thread.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/base/thread.lua b/xmake/core/base/thread.lua index 91dd2a64d..26a6e2c52 100644 --- a/xmake/core/base/thread.lua +++ b/xmake/core/base/thread.lua @@ -914,9 +914,11 @@ function thread._run_thread(callback_str, callinfo_str) -- thread is finished, we need to notify the waited thread if wpipe then - local ok, errors = wpipe:write("1", {block = true}) - if ok < 0 then - return false, errors + if scheduler:co_running() then + local ok, errors = wpipe:write("1", {block = true}) + if ok < 0 then + return false, errors + end end wpipe:close() end |
