thread progress
This commit is contained in:
parent
90ad118219
commit
9f12727d65
1 changed files with 6 additions and 5 deletions
|
|
@ -28,7 +28,7 @@
|
||||||
##
|
##
|
||||||
## InitLock(L)
|
## InitLock(L)
|
||||||
##
|
##
|
||||||
## GC_disable() # native GC does not support multiple thready yet :-(
|
## GC_disable() # native GC does not support multiple threads yet :-(
|
||||||
## for i in 0..high(thr):
|
## for i in 0..high(thr):
|
||||||
## createThread(thr[i], threadFunc, (i*10, i*10+5))
|
## createThread(thr[i], threadFunc, (i*10, i*10+5))
|
||||||
## for i in 0..high(thr):
|
## for i in 0..high(thr):
|
||||||
|
|
@ -53,8 +53,9 @@ include "lib/system/systhread"
|
||||||
type
|
type
|
||||||
TThreadProcClosure {.pure, final.}[TParam] = object
|
TThreadProcClosure {.pure, final.}[TParam] = object
|
||||||
fn: proc (p: TParam)
|
fn: proc (p: TParam)
|
||||||
data: TParam
|
|
||||||
threadLocalStorage: pointer
|
threadLocalStorage: pointer
|
||||||
|
stackBottom: pointer
|
||||||
|
data: TParam
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
type
|
type
|
||||||
|
|
@ -133,7 +134,7 @@ else:
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
noDeadlocks = false # compileOption("deadlockPrevention")
|
noDeadlocks = true # compileOption("deadlockPrevention")
|
||||||
|
|
||||||
type
|
type
|
||||||
TLock* = TSysLock
|
TLock* = TSysLock
|
||||||
|
|
@ -341,7 +342,7 @@ when isMainModule:
|
||||||
for i in 0..high(thr):
|
for i in 0..high(thr):
|
||||||
joinThread(thr[i])
|
joinThread(thr[i])
|
||||||
|
|
||||||
#GC_disable()
|
GC_disable()
|
||||||
main()
|
main()
|
||||||
#GC_enable()
|
GC_enable()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue