GC test workaround: use a lock for 'echo' for Windows
This commit is contained in:
parent
ede38a70fc
commit
7e7ce19ec1
1 changed files with 10 additions and 3 deletions
|
|
@ -11,12 +11,19 @@ discard """
|
|||
sortoutput: true
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
import threadpool, locks
|
||||
|
||||
var echoLock: Lock
|
||||
initLock echoLock
|
||||
|
||||
proc f(a: openArray[int]) =
|
||||
for x in a: echo x
|
||||
for x in a:
|
||||
withLock echoLock:
|
||||
echo x
|
||||
|
||||
proc f(a: int) = echo a
|
||||
proc f(a: int) =
|
||||
withLock echoLock:
|
||||
echo a
|
||||
|
||||
proc main() =
|
||||
var a: array[0..9, int] = [0,1,2,3,4,5,6,7,8,9]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue