File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
26
26
use bevy_utils:: { Duration , HashSet , Instant , Uuid } ;
27
27
use std:: borrow:: Cow ;
28
28
use std:: ffi:: OsString ;
29
- use std:: marker:: PhantomData ;
30
29
use std:: ops:: Range ;
31
30
use std:: path:: { Path , PathBuf } ;
32
31
@@ -117,16 +116,15 @@ impl Plugin for TaskPoolPlugin {
117
116
_app. add_systems ( Last , tick_global_task_pools) ;
118
117
}
119
118
}
120
- /// A dummy type that is [`!Send`](Send), to force systems to run on the main thread.
121
- pub struct NonSendMarker ( PhantomData < * mut ( ) > ) ;
122
119
123
120
/// A system used to check and advanced our task pools.
124
121
///
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.
127
123
#[ 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
+ } ) ;
130
128
}
131
129
132
130
/// Maintains a count of frames rendered since the start of the application.
You can’t perform that action at this time.
0 commit comments