pub struct ProcessState;
Expand description
Static utility functions to manage Binder process state.
Implementations§
Source§impl ProcessState
impl ProcessState
Sourcepub fn start_thread_pool()
pub fn start_thread_pool()
Starts the Binder IPC thread pool.
Starts 1 thread, plus allows the kernel to lazily start up to
num_threads
additional threads as specified by
set_thread_pool_max_thread_count
.
This should be done before creating any Binder client or server. If
neither this nor join_thread_pool
are
called, then some things (such as callbacks and
IBinder::link_to_death
) will silently
not work: the callbacks will be queued but never called as there is no
thread to call them on.
Sourcepub fn set_thread_pool_max_thread_count(num_threads: u32)
pub fn set_thread_pool_max_thread_count(num_threads: u32)
Sets the maximum number of threads that can be started in the threadpool.
By default, after start_thread_pool
is
called, this is 15. If it is called additional times, the thread pool
size can only be increased.
Sourcepub fn join_thread_pool()
pub fn join_thread_pool()
Blocks on the Binder IPC thread pool by adding the current thread to the pool.
Note that this adds the current thread in addition to those that are
created by
set_thread_pool_max_thread_count
and start_thread_pool
.
Auto Trait Implementations§
impl Freeze for ProcessState
impl RefUnwindSafe for ProcessState
impl Send for ProcessState
impl Sync for ProcessState
impl Unpin for ProcessState
impl UnwindSafe for ProcessState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.