mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 14:55:24 +00:00
fixes #1188
This commit is contained in:
@@ -251,7 +251,10 @@ proc `^`*[T](fv: FlowVar[ref T]): ref T =
|
||||
## Blocks until the value is available and then returns this value.
|
||||
blockUntil(fv)
|
||||
let src = cast[ref T](fv.data)
|
||||
deepCopy result, src
|
||||
when defined(nimV2):
|
||||
result = src
|
||||
else:
|
||||
deepCopy result, src
|
||||
finished(fv)
|
||||
|
||||
proc `^`*[T](fv: FlowVar[T]): T =
|
||||
@@ -259,7 +262,10 @@ proc `^`*[T](fv: FlowVar[T]): T =
|
||||
blockUntil(fv)
|
||||
when T is string or T is seq:
|
||||
let src = cast[T](fv.data)
|
||||
deepCopy result, src
|
||||
when defined(nimV2):
|
||||
result = src
|
||||
else:
|
||||
deepCopy result, src
|
||||
else:
|
||||
result = fv.blob
|
||||
finished(fv)
|
||||
|
||||
@@ -136,9 +136,12 @@ else:
|
||||
when TArg is void:
|
||||
thrd.dataFn()
|
||||
else:
|
||||
var x: TArg
|
||||
deepCopy(x, thrd.data)
|
||||
thrd.dataFn(x)
|
||||
when defined(nimV2):
|
||||
thrd.dataFn(thrd.data)
|
||||
else:
|
||||
var x: TArg
|
||||
deepCopy(x, thrd.data)
|
||||
thrd.dataFn(x)
|
||||
finally:
|
||||
afterThreadRuns()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user