3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
23 #include "engine-controller/task.h"
27 * @brief Defines engine controller task pool APIs
30 /** @addtogroup engine_controller
35 * @brief Structure for task pool
37 typedef struct ec_task_pool_s ec_task_pool_t;
40 * @brief Structure for task pool
41 * @remarks it contains only root task
43 struct ec_task_pool_s {
44 GHashTable *task_hash; /**< key : sync_agent_ec_uint (request_id)
49 * @brief Create task pool
50 * @return ec_task_pool_t on success, NULL on fail
51 * @retval ec_task_pool_t Successful
54 ec_task_pool_t *ec_task_pool_create_task_pool();
57 * @brief Free task pool
58 * @param[in] task_pool ec_task_pool_t
60 void ec_task_pool_free_task_pool(ec_task_pool_t * task_pool);
64 * @param[in] task_pool ec_task_pool_t
65 * @param[in] request_id request id
66 * @param[in] task ec_task_t
68 void ec_task_pool_add_task(ec_task_pool_t * task_pool, sync_agent_ec_uint request_id, ec_task_t * task);
72 * @param[in] task_pool ec_task_pool_t
73 * @param[in] request_id request id
74 * @return ec_task_t on success, NULL on fail
75 * @retval ec_task_t Successful
78 ec_task_t *ec_task_pool_fetch_task(ec_task_pool_t * task_pool, sync_agent_ec_uint request_id);
81 * @brief Fetch all tasks
82 * @param[in] task_pool ec_task_pool_t
83 * @return ec_task_t list on success, NULL on fail
84 * @retval ec_task_t list Successful
87 GList *ec_task_pool_fetch_all_tasks(ec_task_pool_t * task_pool);
91 * @param[in] task_pool ec_task_pool_t
92 * @param[in] request_id request id
94 void ec_task_pool_remove_task(ec_task_pool_t * task_pool, sync_agent_ec_uint request_id);
100 #endif /* TASK_POOL_H_ */