diff options
| author | ruki <[email protected]> | 2025-08-27 23:23:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-08-28 11:35:54 +0800 |
| commit | 6809e2d887d3f3f298b4e324a7580c55ac47562d (patch) | |
| tree | 38d2ca2a0595636e0f5f12ab57d1516992049f3b /tests/modules/thread/mutex.lua | |
| parent | 7bf08a61f291294d0dc021be62dec253146115f1 (diff) | |
move thread to base
Diffstat (limited to 'tests/modules/thread/mutex.lua')
| -rw-r--r-- | tests/modules/thread/mutex.lua | 11 |
1 files changed, 5 insertions, 6 deletions
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 |
