mirror of
https://github.com/logos-storage/nim-libplum.git
synced 2026-06-07 09:40:01 +00:00
Add try and finally to make sure teardown is called
This commit is contained in:
parent
bf0ace8da2
commit
9867ec4787
@ -79,9 +79,11 @@ type
|
|||||||
template foreignThreadGc(body: untyped) =
|
template foreignThreadGc(body: untyped) =
|
||||||
when declared(setupForeignThreadGc):
|
when declared(setupForeignThreadGc):
|
||||||
setupForeignThreadGc()
|
setupForeignThreadGc()
|
||||||
body
|
try:
|
||||||
when declared(tearDownForeignThreadGc):
|
body
|
||||||
tearDownForeignThreadGc()
|
finally:
|
||||||
|
when declared(tearDownForeignThreadGc):
|
||||||
|
tearDownForeignThreadGc()
|
||||||
|
|
||||||
var activeMappingsLock: Lock
|
var activeMappingsLock: Lock
|
||||||
var activeMappings {.guard: activeMappingsLock.}: Table[cint, MappingHandle]
|
var activeMappings {.guard: activeMappingsLock.}: Table[cint, MappingHandle]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user