Skip to content

Commit d095a67

Browse files
committed
bevy_core changes
1 parent b4420b3 commit d095a67

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/bevy_core/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
2626
use bevy_utils::{Duration, HashSet, Instant, Uuid};
2727
use std::borrow::Cow;
2828
use std::ffi::OsString;
29-
use std::marker::PhantomData;
3029
use std::ops::Range;
3130
use std::path::{Path, PathBuf};
3231

@@ -117,16 +116,15 @@ impl Plugin for TaskPoolPlugin {
117116
_app.add_systems(Last, tick_global_task_pools);
118117
}
119118
}
120-
/// A dummy type that is [`!Send`](Send), to force systems to run on the main thread.
121-
pub struct NonSendMarker(PhantomData<*mut ()>);
122119

123120
/// A system used to check and advanced our task pools.
124121
///
125-
/// Calls [`tick_global_task_pools_on_main_thread`],
126-
/// and uses [`NonSendMarker`] to ensure that this system runs on the main thread
122+
/// Calls [`tick_global_task_pools_on_main_thread`] on the main thread.
127123
#[cfg(not(target_arch = "wasm32"))]
128-
fn tick_global_task_pools(_main_thread_marker: Option<NonSend<NonSendMarker>>) {
129-
tick_global_task_pools_on_main_thread();
124+
fn tick_global_task_pools(mut main_thread: ThreadLocal) {
125+
main_thread.run(|_| {
126+
tick_global_task_pools_on_main_thread();
127+
});
130128
}
131129

132130
/// Maintains a count of frames rendered since the start of the application.

0 commit comments

Comments
 (0)