#ifndef __PAL_THREADPOOL_H__
#define __PAL_THREADPOOL_H__
#include <stdint.h>
#include "list.h"
#include "threadpool.h"


typedef threadpool workqueue;

/** workqueue_init
 *  [in] max_cnt, thread/task max count if need
// 
void workqueue_deinit(workqueue *wq);
*/

workqueue *workqueue_init(uint32_t max_cnt);

/** workqueue_deinit
 *  no need to deinit commomly
*/
void workqueue_deinit(workqueue *wq);


// add a work to workqueue
// entry as callback
/**
 * @brief Add a work to workqueue.
 *
 * @param [in] wq, workqueue instance.
 * @param [in] entry, as callback func.
 * @param [in] packet, param to entry.
 * @param [in] type, urge level.
 * @param [in] delayms, run after ms.
 * @retval 0 Mutex lock create successfully.
 * @retval ZFAILED Mutex lock create failed.
 *
 * @see os_mutex_delete
 */
uint32_t workqueue_add(workqueue *wq, thread_routine routine, kpacket *packet);

void workqueue_test();

void workqueue_dump();



#endif /* __PAL_THREADPOOL_H__ */
