aboutsummaryrefslogtreecommitdiff
path: root/tests/h.lua
blob: ca946fca5dff81c94c6a1223194bcad0abe73e06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require "llib"

--llib.thread.lock(1)
--llib.thread.lock(2)
--llib.thread.unlock(2)

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)

--os.execute("sleep 1")
--print("unlock")
--llib.thread.unlock(1)


awa = thread_a:await()

print(awa:await())
--print((awa + "hi"):final())
thread_a:clean()

print("clean exit")