source: libcf/trunk/include/cf_thread.h@ 126

Last change on this file since 126 was 126, checked in by cheese, 11 years ago

#1 separate header/source files for thread and mutex

File size: 761 bytes
RevLine 
[4]1/**
[119]2 * \file cf_thread.h
3 * \author myusgun <myusgun@gmail.com>
[26]4 *
[126]5 * \brief 멀티스레드 지원
[26]6 *
[119]7 * \example thread.c
[26]8 */
[34]9#ifndef __CF_THREAD_H__
10#define __CF_THREAD_H__
11
12#include "cf_base.h"
13
[126]14#include "cf_mutex.h"
15
[59]16/** 스레드 워커 함수 프로토타입 */
[57]17typedef int (* CF_Thread_Function) (void *);
[34]18
[122]19/** 스레드 컨텍스트 */
[109]20typedef void * CF_Thread_Ctx;
[34]21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
[4]26CF_EXPORT int
[122]27CF_Thread_CreateCtx (CF_Thread_Ctx * ctx,
[109]28 CF_Thread_Function callback,
29 void * arg);
[4]30
31CF_EXPORT int
[122]32CF_Thread_Start (CF_Thread_Ctx ctx);
[4]33
34CF_EXPORT int
[122]35CF_Thread_DestroyCtx (CF_Thread_Ctx ctx);
[4]36
37CF_EXPORT int
[122]38CF_Thread_Join (CF_Thread_Ctx ctx);
[4]39
40#ifdef __cplusplus
41}
42#endif
43
44#endif // #ifndef __CF_THREAD_H__
Note: See TracBrowser for help on using the repository browser.