• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
30  * startThreadPool is called, this is one. If it is called additional times, it will only prevent
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
41