2 * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __AUL_WORKER_H__
18 #define __AUL_WORKER_H__
22 typedef void *aul_worker_h;
33 typedef bool (*aul_worker_io_job_cb)(int fd, int condition, void *user_data);
35 aul_worker_h aul_worker_create(const char *name);
37 void aul_worker_destroy(aul_worker_h handle);
39 int aul_worker_add_io_job(aul_worker_h handle, const char *job_name,
40 int fd, int condition, bool do_close,
41 aul_worker_io_job_cb callback, void *user_data);
43 void aul_worker_remove_io_job(aul_worker_h handle, int fd);
45 int aul_worker_add_anr_timer(aul_worker_h handle,
46 int cmd, unsigned int timeout);
48 int aul_worker_remove_anr_timer(aul_worker_h handle);
50 #endif /* __AUL_WORKER_H__ */