module
Godot::ThreadSafety
Defined in:
libgodot/thread_safety.crClass Method Summary
-
.assert_main_thread!(operation : String, target_class : String, node : Godot::Node | Nil = nil, child : Godot::Node | Nil = nil) : Void
Master assertion called before thread-sensitive operations
-
.context_description : String
Detailed human-readable description of current thread & execution context
-
.current_thread_id : UInt64
Fast query for native OS thread ID (~1ns, TLS segment register read)
-
.flush_main_thread_queue! : Void
Flushes and executes all enqueued main thread actions.
-
.main_thread? : Bool
Returns true if current execution is on Godot's Main Thread
- .main_thread_id : UInt64
-
.main_thread_id=(id : UInt64)
Explicitly overrides the main thread ID (for test fixtures).
- .policy : Policy
- .policy=(policy : Policy)
-
.record_main_thread! : UInt64
Records the current thread as Godot's Main Thread.
-
.reset! : Void
Resets main thread tracking (primarily for isolated test fixtures).
-
.run_on_main_thread(&block : -> Void) : Void
Schedules a block to execute on the Main Thread.
- .scope : Scope
- .scope=(scope : Scope)
Class Method Detail
Master assertion called before thread-sensitive operations
Detailed human-readable description of current thread & execution context
Fast query for native OS thread ID (~1ns, TLS segment register read)
Flushes and executes all enqueued main thread actions. Called by the main loop during frame updates.
Explicitly overrides the main thread ID (for test fixtures).
Schedules a block to execute on the Main Thread. If already on the Main Thread, executes immediately. If on a background thread, enqueues to the thread-safe dispatch queue.