#ifndef __OSAL_THREAD_H__
#define __OSAL_THREAD_H__

#include "osal_def.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef void* osal_thread_t;
typedef void (*osal_thread_entry)(void* parameter);

/* Thread API */
osal_thread_t osal_thread_create(const char* name,
                               osal_thread_entry entry,
                               void* parameter,
                               osal_size_t stack_size,
                               osal_priority_t priority);

osal_err_t osal_thread_delete(osal_thread_t thread);
osal_err_t osal_thread_start(osal_thread_t thread);
osal_err_t osal_thread_suspend(osal_thread_t thread);
osal_err_t osal_thread_resume(osal_thread_t thread);
osal_err_t osal_thread_yield(void);
osal_err_t osal_thread_control(osal_thread_t thread, int cmd, void* arg);
osal_thread_t osal_thread_self(void);
osal_err_t osal_thread_delay(osal_tick_t tick);
osal_err_t osal_thread_mdelay(osal_int32_t ms);

#ifdef __cplusplus
}
#endif

#endif /* __OSAL_THREAD_H__ */
