Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <stdint.h> |
| 20 | #include <sys/cdefs.h> |
| 21 | |
| 22 | __BEGIN_DECLS |
| 23 | |
| 24 | /** |
| 25 | * This creates a threadpool for incoming binder transactions if it has not already been created. |
| 26 | */ |
| 27 | void ABinderProcess_startThreadPool(); |
| 28 | /** |
| 29 | * This sets the maximum number of threads that can be started in the threadpool. By default, after |
Steven Moreland | 21f5f9a | 2019-07-25 16:46:13 -0700 | [diff] [blame] | 30 | * startThreadPool is called, this is 15. If it is called additional times, it will only prevent |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 31 | * the kernel from starting new threads and will not delete already existing threads. |
| 32 | */ |
| 33 | bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); |
| 34 | /** |
| 35 | * This adds the current thread to the threadpool. This may cause the threadpool to exceed the |
| 36 | * maximum size. |
| 37 | */ |
| 38 | void ABinderProcess_joinThreadPool(); |
| 39 | |
| 40 | __END_DECLS |