diff options
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 |
