Merge pull request #42 from logos-messaging/initialize-lock

initialize ctxPoolLock to avoid crash on Windows/iOS
This commit is contained in:
Ivan FB 2026-01-14 12:16:15 +01:00 committed by GitHub
commit 239f619625
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,7 @@ proc initializeLibrary() {.exported.} =
## Every Nim library needs to call `<yourprefix>NimMain` once exactly, to initialize the Nim runtime.
## Being `<yourprefix>` the value given in the optional compilation flag --nimMainPrefix:yourprefix
libsdsNimMain()
ctxPoolLock.initLock() # ensure the lock is initialized once (fix Windows crash)
when declared(setupForeignThreadGc):
setupForeignThreadGc()
when declared(nimGC_setStackBottom):