LEVIATHAN vd52e79c4 · d52e79c486

Standard Library · ffi

attribute reentrant

Asserts that a foreign function tolerates another task entering its library while a callback from that library is waiting.

since 0.1.0-alpha.1linuxwindowswasm

Overview

Without the mark, that interleaving raises an FfiException instead of running. The compiler cannot check the claim; a library as a whole is marked with reentrant = true in its [[native]] table.

Examples

Marking a function reentrant

uses ffi;
use io::console;

@extern("c", "labs")
@reentrant
int absolute(int n);

console.writeln(absolute(-3));
3

Fields

value

bool value

Whether the mark applies.