blob: fdefbb4b8af02f784a69d69461da26cc33903a0f [file] [log] [blame]
Steven Moreland2e87adc2018-08-20 19:47:00 -07001/*
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 */
27void ABinderProcess_startThreadPool();
28/**
29 * This sets the maximum number of threads that can be started in the threadpool. By default, after
Steven Moreland21f5f9a2019-07-25 16:46:13 -070030 * startThreadPool is called, this is 15. If it is called additional times, it will only prevent
Steven Moreland2e87adc2018-08-20 19:47:00 -070031 * the kernel from starting new threads and will not delete already existing threads.
32 */
33bool 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 */
38void ABinderProcess_joinThreadPool();
39
40__END_DECLS