From 152b605c856112b074dc7b41651424c4170fc067 Mon Sep 17 00:00:00 2001 From: ame Date: Sat, 25 May 2024 04:08:59 -0500 Subject: fixed deepcopy --- tests/h.lua | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'tests/h.lua') diff --git a/tests/h.lua b/tests/h.lua index ca946fc..412d09c 100644 --- a/tests/h.lua +++ b/tests/h.lua @@ -1,32 +1,29 @@ require "llib" +llib.config.set({print_meta=1,max_depth=22}) --llib.thread.lock(1) --llib.thread.lock(2) --llib.thread.unlock(2) +a = llib.thread.buffer(llib.crypto.md5()) -local thread_a = llib.thread.async(function (res) - --os.execute("sleep 1") - --print((_G.ll + "hi"):final()) - print("waiting..") - --llib.thread.lock(1) - _G.test = 5 - print("signal!") - res(llib.thread.async(function (res) - print(test) - res(test) - end)) - print("after") -end) +a:mod(function(e) return e end) +print("hi") +for i=1,20 do + llib.thread.async(function (res) + a:mod(function(e) return e:update("meow") end) + end) +end ---os.execute("sleep 1") +os.execute("sleep 1") +print(a:get():final()) --print("unlock") --llib.thread.unlock(1) -awa = thread_a:await() +--awa = thread_a:await() -print(awa:await()) +--print(awa:await()) --print((awa + "hi"):final()) -thread_a:clean() +--thread_a:clean() print("clean exit") -- cgit v1.2.3