From 6809e2d887d3f3f298b4e324a7580c55ac47562d Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 27 Aug 2025 23:23:00 +0800 Subject: move thread to base --- tests/modules/thread/mutex.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/modules/thread/mutex.lua') diff --git a/tests/modules/thread/mutex.lua b/tests/modules/thread/mutex.lua index 472b228db..0f1954c8a 100644 --- a/tests/modules/thread/mutex.lua +++ b/tests/modules/thread/mutex.lua @@ -1,8 +1,7 @@ -import("core.thread.thread") -import("core.thread.mutex") +import("core.base.thread") function callback(mutex) - import("core.thread.thread") + import("core.base.thread") print("%s: starting ..", thread.running()) local dt = os.mclock() for i = 1, 10 do @@ -16,9 +15,9 @@ function callback(mutex) end function main() - local m = mutex.new() - local t0 = thread.start_named("thread_0", callback, m) - local t1 = thread.start_named("thread_1", callback, m) + local mutex = thread.mutex() + local t0 = thread.start_named("thread_0", callback, mutex) + local t1 = thread.start_named("thread_1", callback, mutex) t0:wait(-1) t1:wait(-1) end -- cgit v1.3.1