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
|
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 | #include "cf_mutex.h"
|
---|
15 |
|
---|
16 | /** 스레드 워커 함수 프로토타입 */
|
---|
17 | typedef int (* CF_Thread_Function) (void *);
|
---|
18 |
|
---|
19 | /** 스레드 컨텍스트 */
|
---|
20 | typedef void * CF_Thread_Ctx;
|
---|
21 |
|
---|
22 | #ifdef __cplusplus
|
---|
23 | extern "C" {
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | CF_EXPORT int
|
---|
27 | CF_Thread_CreateCtx (CF_Thread_Ctx * ctx,
|
---|
28 | CF_Thread_Function callback,
|
---|
29 | void * arg);
|
---|
30 |
|
---|
31 | CF_EXPORT int
|
---|
32 | CF_Thread_Start (CF_Thread_Ctx ctx);
|
---|
33 |
|
---|
34 | CF_EXPORT int
|
---|
35 | CF_Thread_DestroyCtx (CF_Thread_Ctx ctx);
|
---|
36 |
|
---|
37 | CF_EXPORT int
|
---|
38 | CF_Thread_Join (CF_Thread_Ctx ctx);
|
---|
39 |
|
---|
40 | #ifdef __cplusplus
|
---|
41 | }
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | #endif // #ifndef __CF_THREAD_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.