/** * @file cf_thread.h * @author myusgun * * @remark 멀티스레드 및 뮤텍스 지원 * * @example thread.c */ #ifndef __CF_THREAD_H__ #define __CF_THREAD_H__ #include "cf_base.h" /** 스레드 워커 함수 프로토타입 */ typedef int (* CF_Thread_Function) (void *); /** 스레드 아이디 */ typedef void * CF_Thread_Ctx; /** 뮤텍스 아이디 */ typedef void * CF_Mutex_Ctx; #ifdef __cplusplus extern "C" { #endif CF_EXPORT int CF_Thread_CreateCtx (CF_Thread_Ctx * threadID, CF_Thread_Function callback, void * arg); CF_EXPORT int CF_Thread_DestroyCtx (CF_Thread_Ctx * threadID); CF_EXPORT int CF_Thread_Join (CF_Thread_Ctx * threadID); CF_EXPORT int CF_Mutex_CreateCtx (CF_Mutex_Ctx * mutex); CF_EXPORT int CF_Mutex_DestoryCtx (CF_Mutex_Ctx * mutex); CF_EXPORT int CF_Mutex_Lock (CF_Mutex_Ctx * mutex); CF_EXPORT int CF_Mutex_Unlock (CF_Mutex_Ctx * mutex); #ifdef __cplusplus } #endif #endif // #ifndef __CF_THREAD_H__