summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-21 19:31:18 +0200
committerAraq <rumpf_a@web.de>2012-09-21 19:31:18 +0200
commit505f179515fb8f0aa2ac15cb54af8c206f3eddda (patch)
treec7d2d13b7e42505f86aba4c63a6b10320052e27e
parent32aa46a8813ebfde12cf3593362e0809e81d415f (diff)
downloadNim-505f179515fb8f0aa2ac15cb54af8c206f3eddda.tar.gz
added tactors2 test
-rw-r--r--tests/threads/tactors2.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/threads/tactors2.nim b/tests/threads/tactors2.nim
new file mode 100644
index 000000000..5683f98ba
--- /dev/null
+++ b/tests/threads/tactors2.nim
@@ -0,0 +1,25 @@
+discard """
+  output: "1"
+"""
+
+import actors
+
+type
+  some_type {.pure, final.} = object
+    bla: int
+
+proc thread_proc(input: some_type): some_type {.thread.} =
+  result.bla = 1
+
+proc main() =
+  var actorPool: TActorPool[some_type, some_type]
+  createActorPool(actorPool, 1)
+
+  var some_data: some_type
+  
+  var inchannel = spawn(actorPool, some_data, thread_proc)
+  var recv_data = ^inchannel
+  close(inchannel[])
+  echo recv_data.bla
+
+main()