Function binder_ndk_sys::ABinderProcess_startThreadPool

source ยท
pub unsafe extern "C" fn ABinderProcess_startThreadPool()
Expand description

This creates a threadpool for incoming binder transactions if it has not already been created, spawning one thread, and allowing the kernel to lazily start threads according to the count that is specified in ABinderProcess_setThreadPoolMaxThreadCount.

For instance, if ABinderProcess_setThreadPoolMaxThreadCount(3) is called, ABinderProcess_startThreadPool() is called (+1 thread) then the main thread calls ABinderProcess_joinThreadPool() (+1 thread), up to 5 total threads will be started (2 directly, and 3 more if the kernel starts them lazily).

When using this, it is expected that ABinderProcess_setupPolling and ABinderProcess_handlePolledCommands are not used.

Do not use this from a library. Apps setup their own threadpools, and otherwise, the main function should be responsible for configuring the threadpool for the entire application.