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

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

#1 modify id to context in thread

File size: 1.0 KB
Line 
1/**
2 * \file cf_thread.h
3 * \author myusgun <myusgun@gmail.com>
4 *
5 * \brief 멀티스레드 및 뮤텍스 지원
6 *
7 * \example thread.c
8 */
9#ifndef __CF_THREAD_H__
10#define __CF_THREAD_H__
11
12#include "cf_base.h"
13
14/** 스레드 워커 함수 프로토타입 */
15typedef int (* CF_Thread_Function) (void *);
16
17/** 스레드 컨텍스트 */
18typedef void * CF_Thread_Ctx;
19
20/** 뮤텍스 컨텍스트 */
21typedef void * CF_Mutex_Ctx;
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27CF_EXPORT int
28CF_Thread_CreateCtx (CF_Thread_Ctx * ctx,
29 CF_Thread_Function callback,
30 void * arg);
31
32CF_EXPORT int
33CF_Thread_Start (CF_Thread_Ctx ctx);
34
35CF_EXPORT int
36CF_Thread_DestroyCtx (CF_Thread_Ctx ctx);
37
38CF_EXPORT int
39CF_Thread_Join (CF_Thread_Ctx ctx);
40
41CF_EXPORT int
42CF_Mutex_CreateCtx (CF_Mutex_Ctx * ctx);
43
44CF_EXPORT int
45CF_Mutex_DestoryCtx (CF_Mutex_Ctx ctx);
46
47CF_EXPORT int
48CF_Mutex_Lock (CF_Mutex_Ctx ctx);
49
50CF_EXPORT int
51CF_Mutex_Unlock (CF_Mutex_Ctx ctx);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif // #ifndef __CF_THREAD_H__
Note: See TracBrowser for help on using the repository browser.