File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ pub fn spawn(future: impl Future<Output = ()> + 'static) -> TaskHandle {
95
95
// By limiting async tasks to the main thread we can redirect all signal callbacks back to the main thread via `call_deferred`.
96
96
//
97
97
// Once thread-safe futures are possible the restriction can be lifted.
98
- #[ cfg( not( wasm_nothreads) ) ]
99
98
assert ! (
100
99
crate :: init:: is_main_thread( ) ,
101
100
"godot_task() can only be used on the main thread"
Original file line number Diff line number Diff line change @@ -435,9 +435,17 @@ pub fn main_thread_id() -> std::thread::ThreadId {
435
435
///
436
436
/// # Panics
437
437
/// - If it is called before the engine bindings have been initialized.
438
- # [ cfg ( not ( wasm_nothreads ) ) ]
438
+ ///
439
439
pub fn is_main_thread ( ) -> bool {
440
- std:: thread:: current ( ) . id ( ) == main_thread_id ( )
440
+ #[ cfg( not( wasm_nothreads) ) ]
441
+ {
442
+ std:: thread:: current ( ) . id ( ) == main_thread_id ( )
443
+ }
444
+
445
+ #[ cfg( wasm_nothreads) ]
446
+ {
447
+ true
448
+ }
441
449
}
442
450
443
451
// ----------------------------------------------------------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments