aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexey Melnichuk <mimir@newmail.ru>2014-06-25 10:11:17 +0500
committerAlexey Melnichuk <mimir@newmail.ru>2014-06-25 10:11:17 +0500
commit3de8f797d0e235efd20fdc9c55c8068893f4fd03 (patch)
treee995e196db486bab6edfd6023c1e41bd1875caf8 /test
parent04dce92542c727041ae042ede83a94e0e5e5a99f (diff)
downloadlua-llthreads2-3de8f797d0e235efd20fdc9c55c8068893f4fd03.tar.gz
lua-llthreads2-3de8f797d0e235efd20fdc9c55c8068893f4fd03.tar.bz2
lua-llthreads2-3de8f797d0e235efd20fdc9c55c8068893f4fd03.zip
Add. started/detached/joinable methods to thread object.
Diffstat (limited to 'test')
-rw-r--r--test/test_threads_attr.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_threads_attr.lua b/test/test_threads_attr.lua
new file mode 100644
index 0000000..fbcb036
--- /dev/null
+++ b/test/test_threads_attr.lua
@@ -0,0 +1,21 @@
1local llthreads = require"llthreads.ex"
2
3local thread = llthreads.new(function() return 1 end)
4
5assert(not thread:started())
6
7-- thread is not started so this is not valid values
8assert(not thread:detached())
9assert(not thread:joinable())
10
11assert(thread:start(true, true))
12
13assert(thread:detached())
14assert(thread:joinable())
15
16assert(thread:join())
17
18assert(thread:started())
19assert(not thread:alive())
20
21print("done!") \ No newline at end of file