Add a helper for initializing fsStdOut in threads
This commit is contained in:
parent
65f82f2f2d
commit
4f6c874c10
1 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
import
|
import
|
||||||
outputs
|
outputs
|
||||||
|
|
||||||
let fsStdOut* {.threadvar.} = fileOutput(system.stdout)
|
var fsStdOut* {.threadvar.}: OutputStream
|
||||||
|
|
||||||
|
proc initFsStdOut* =
|
||||||
|
## This proc must be called in each thread where
|
||||||
|
## the `fsStdOut` variable will be used.
|
||||||
|
if fsStdOut == nil:
|
||||||
|
fsStdOut = fileOutput(system.stdout)
|
||||||
|
|
||||||
|
initFsStdOut()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue