WIP
This commit is contained in:
+8
-4
@@ -413,7 +413,7 @@ impl MutableAppContext {
|
||||
windows: HashMap::new(),
|
||||
ref_counts: Arc::new(Mutex::new(RefCounts::default())),
|
||||
background: Arc::new(executor::Background::new()),
|
||||
scoped_pool: scoped_pool::Pool::new(num_cpus::get()),
|
||||
thread_pool: scoped_pool::Pool::new(num_cpus::get()),
|
||||
},
|
||||
actions: HashMap::new(),
|
||||
global_actions: HashMap::new(),
|
||||
@@ -1316,7 +1316,7 @@ pub struct AppContext {
|
||||
windows: HashMap<usize, Window>,
|
||||
background: Arc<executor::Background>,
|
||||
ref_counts: Arc<Mutex<RefCounts>>,
|
||||
scoped_pool: scoped_pool::Pool,
|
||||
thread_pool: scoped_pool::Pool,
|
||||
}
|
||||
|
||||
impl AppContext {
|
||||
@@ -1356,8 +1356,8 @@ impl AppContext {
|
||||
&self.background
|
||||
}
|
||||
|
||||
pub fn scoped_pool(&self) -> &scoped_pool::Pool {
|
||||
&self.scoped_pool
|
||||
pub fn thread_pool(&self) -> &scoped_pool::Pool {
|
||||
&self.thread_pool
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1505,6 +1505,10 @@ impl<'a, T: Entity> ModelContext<'a, T> {
|
||||
&self.app.ctx.background
|
||||
}
|
||||
|
||||
pub fn thread_pool(&self) -> &scoped_pool::Pool {
|
||||
&self.app.ctx.thread_pool
|
||||
}
|
||||
|
||||
pub fn halt_stream(&mut self) {
|
||||
self.halt_stream = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user