From ad77d170e407fc7d346df32a88683aae050bf36b Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 18 Apr 2025 22:42:48 +0800 Subject: run thread --- xmake/core/thread/thread.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xmake/core/thread/thread.lua') diff --git a/xmake/core/thread/thread.lua b/xmake/core/thread/thread.lua index cac5d916d..33ac3dca0 100644 --- a/xmake/core/thread/thread.lua +++ b/xmake/core/thread/thread.lua @@ -91,11 +91,14 @@ function _instance:start() assert(not self:cdata()) -- serialize and pass callback and arguments to this thread - local callback = string.serialize(self._CALLBACK, {strip = true, indent = false}) - local argv = string.serialize(self._ARGV, {strip = true, indent = false}) + local callinfo = { + callback = self._CALLBACK, + argv = self._ARGV + } + callinfo = string.serialize(callinfo, {strip = true, indent = false}) -- init and start thread - local handle, errors = thread.thread_init(self:name(), callback, argv, self._STACKSIZE) + local handle, errors = thread.thread_init(self:name(), callinfo, self._STACKSIZE) if not handle then return nil, errors or string.format("%s: failed to create thread!", self) end -- cgit v1.3.1