Lyricdev
GitHub

LYR-RT0022

a Lyric function called from a thread Lyric does not run

panic · spec 13-abi

C called a Lyric function through its pointer on a thread the runtime does not know: one C started itself, which no collector attached. A Callback that returns nothing goes to the thread that made it; any other call — a function's, a Callback's that returns a value, one whose thread runs no scheduler — has no Lyric to run on, and the process ends. An export called before lyr_init started the runtime ends it the same way.

Explanation

A Lyric function C calls runs on the thread that calls it, with that thread's stack, its collector and its tasks. A thread C started itself has none of them: the runtime never saw it. The callback ends the process with this report rather than run without them.

Call the callback from the thread that handed it to C — the one Lyric runs on.

Example

$ ./out/debug/x86_64-linux-gnu/app
panic [LYR-RT0022]: C called a Lyric function on a thread Lyric does not run