From fe82e54bfa584c107955084a355f3fcd62f04c06 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 20 Aug 2024 00:06:26 +0000 Subject: binder_process.h: clarify thread start behavior Be explicit that joinThreadPool does not also start the threadpool. Bug: N/A (email thread) Change-Id: I0572dfbdbf152502fbde6f8cdd624b5b2025459f Test: N/A --- libs/binder/ndk/include_platform/android/binder_process.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/binder/ndk/include_platform/android/binder_process.h b/libs/binder/ndk/include_platform/android/binder_process.h index 68528e1004..6aff994a15 100644 --- a/libs/binder/ndk/include_platform/android/binder_process.h +++ b/libs/binder/ndk/include_platform/android/binder_process.h @@ -47,8 +47,11 @@ void ABinderProcess_startThreadPool(void); * be called once before startThreadPool. The number of threads can never decrease. * * This count refers to the number of threads that will be created lazily by the kernel, in - * addition to the threads created by ABinderProcess_startThreadPool or - * ABinderProcess_joinThreadPool. + * addition to the single threads created by ABinderProcess_startThreadPool (+1) or + * ABinderProcess_joinThreadPool (+1). Note: ABinderProcess_startThreadPool starts a thread + * itself, but it also enables up to the number of threads passed to this function to start. + * This function does not start any threads itself; it only configures + * ABinderProcess_startThreadPool. * * 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. @@ -63,8 +66,8 @@ bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); bool ABinderProcess_isThreadPoolStarted(void); /** * This adds the current thread to the threadpool. This thread will be in addition to the thread - * started by ABinderProcess_startThreadPool and the lazy kernel-started threads specified by - * ABinderProcess_setThreadPoolMaxThreadCount. + * configured with ABinderProcess_setThreadPoolMaxThreadCount and started with + * ABinderProcess_startThreadPool. * * 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. -- cgit v1.2.3-59-g8ed1b