prepare nim-chronos for Nim version 1.2

This commit is contained in:
Araq 2020-03-10 15:33:09 +01:00 committed by zah
parent 7ed9f1431a
commit f3827a13d1
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ template createCb(retFutureSym, iteratorNameSym,
var nameIterVar = iteratorNameSym
{.push stackTrace: off.}
proc identName(udata: pointer = nil) {.closure.} =
proc identName(udata: pointer = nil) {.closure, gcsafe.} =
try:
if not(nameIterVar.finished()):
var next = nameIterVar()
@ -48,7 +48,7 @@ template createCb(retFutureSym, iteratorNameSym,
else:
{.gcsafe.}:
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
next.callback = CallbackFunc(identName)
next.callback = identName
{.pop.}
except CancelledError:
retFutureSym.cancel()

View File

@ -11,8 +11,8 @@ import ../chronos
when defined(nimHasUsed): {.used.}
suite "Asynchronous sync primitives test suite":
var testLockResult = ""
var testEventResult = ""
var testLockResult {.threadvar.}: string
var testEventResult {.threadvar.}: string
var testQueue1Result = 0
var testQueue2Result = 0
var testQueue3Result = 0