Ivan FB e22b887d7c
fix(library): block first-time callers until NimMain completes
initializeLibrary ran NimMain only on the thread that won
`initialized.exchange(true)`; concurrent first-time callers fell straight
through and used a half-initialized Nim runtime — a heap-corrupting race
when multiple foreign (e.g. Go) threads create the first context at once.
Add an `initDone` flag the winner sets after NimMain; the others spin
until it is set before proceeding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:11:39 +02:00
..
2026-04-27 21:22:45 +02:00
2026-05-08 14:14:16 -03:00