basic thread support; still broken on Windows; untested on Mac OS X

This commit is contained in:
Araq 2011-01-18 02:22:01 +01:00
commit 66cfc851a1
17 changed files with 521 additions and 127 deletions

21
tests/gc/tthreads.nim Normal file
View file

@ -0,0 +1,21 @@
import threads
var
thr: array [0..4, TThread]
L: TLock
proc threadFunc(c: pointer) {.procvar.} =
for i in 0..9:
Aquire(L)
echo i
Release(L)
InitLock(L)
for i in 0..high(thr):
createThread(thr[i], threadFunc)
for i in 0..high(thr):
joinThread(thr[i])