Skip to content

Commit 832d73b

Browse files
committed
Update callback docs
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent f49228c commit 832d73b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lua.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,12 @@ pub const Lua = struct {
228228
/// any combination of the following methods, which will be automatically registered
229229
/// if present:
230230
///
231-
/// - `interrupt(state: *State, gc: i32) void` - Called at safepoints (loop back edges, call/ret, gc)
231+
/// Thread Safety:
232+
/// - The `interrupt` callback can be set from any thread safely
233+
/// - All other callbacks can only be changed when the VM is not running code
234+
/// - This is enforced by the underlying Luau VM for thread safety
235+
///
236+
/// - `interrupt(state: *State, gc: i32) void` - Called at safepoints (loop back edges, call/ret, gc). Thread-safe to set.
232237
/// - `panic(state: *State, errcode: i32) void` - Called on unprotected errors (if longjmp is used)
233238
/// - `userthread(parent: ?*State, thread: *State) void` - Called when thread is created/destroyed
234239
/// - `useratom(s: []const u8) i16` - Called when string is created; returns atom ID

0 commit comments

Comments
 (0)