2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
23 * @brief The worker structure.
25 typedef struct worker worker_t;
28 * @brief Creates the worker.
30 worker_t *worker_create();
33 * @brief Destroys the worker.
35 void worker_destroy(worker_t *worker);
38 * @brief Syncs the worker.
39 * @remarks Function blocks until all current tasks are finished.
41 void worker_sync(worker_t *worker);
44 * @brief Sets maximum number of threads that the worker can use.
45 * @param[in] worker Worker reference.
46 * @param[in] max_threads Maximum number of threads that worker can use.
48 void worker_set_max_num_of_threads(worker_t *worker, int max_threads);
51 * @brief Adds new task to the task queue.
52 * @param[in] worker Worker reference.
53 * @param[in] task Task to do.
55 int worker_enqueue_task(worker_t *worker, task_t *task);