diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-09-20 18:01:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 18:01:07 +0200 |
commit | 04cecdf9c28c1f1d526d209c582afe7daa7fe654 (patch) | |
tree | 58a4f355553a290091adef7e9cdc839ea0e08a81 | |
parent | cdac67376c599c39e748401e8c0a82ab51a87326 (diff) | |
download | Nim-04cecdf9c28c1f1d526d209c582afe7daa7fe654.tar.gz |
async: removed the 'unown' references, async never worked with --newruntime anyway and --newruntime is dead (#15374)
-rw-r--r-- | lib/pure/asyncmacro.nim | 11 | ||||
-rw-r--r-- | lib/system/orc.nim | 7 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index 219ef6c67..65cf2f3b9 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -14,21 +14,20 @@ import macros, strutils, asyncfutures template createCb(retFutureSym, iteratorNameSym, strName, identName, futureVarCompletions: untyped) = bind finished - let retFutUnown = unown retFutureSym var nameIterVar = iteratorNameSym proc identName {.closure.} = try: if not nameIterVar.finished: - var next = unown nameIterVar() + var next = nameIterVar() # Continue while the yielded future is already finished. while (not next.isNil) and next.finished: - next = unown nameIterVar() + next = nameIterVar() if nameIterVar.finished: break if next == nil: - if not retFutUnown.finished: + if not retFutureSym.finished: let msg = "Async procedure ($1) yielded `nil`, are you await'ing a " & "`nil` Future?" raise newException(AssertionDefect, msg % strName) @@ -39,12 +38,12 @@ template createCb(retFutureSym, iteratorNameSym, {.pop.} except: futureVarCompletions - if retFutUnown.finished: + if retFutureSym.finished: # Take a look at tasyncexceptions for the bug which this fixes. # That test explains it better than I can here. raise else: - retFutUnown.fail(getCurrentException()) + retFutureSym.fail(getCurrentException()) identName() proc createFutureVarCompletions(futureVarIdents: seq[NimNode], diff --git a/lib/system/orc.nim b/lib/system/orc.nim index ac6211ebb..cf8d6379a 100644 --- a/lib/system/orc.nim +++ b/lib/system/orc.nim @@ -103,9 +103,10 @@ proc nimTraceRefDyn(q: pointer; env: pointer) {.compilerRtl, inline.} = j.traceStack.add(head p[], cast[ptr PNimTypeV2](p[])[]) template orcAssert(cond, msg) = - if not cond: - cfprintf(cstderr, "[Bug!] %s\n", msg) - quit 1 + when logOrc: + if not cond: + cfprintf(cstderr, "[Bug!] %s\n", msg) + quit 1 var roots {.threadvar.}: CellSeq |