Line | |
---|
1 | /**
|
---|
2 | * @file cf_thread.h
|
---|
3 | * @author myusgun <myusgun@gmail.com>
|
---|
4 | * @version 0.1
|
---|
5 | *
|
---|
6 | * @remark 멀티스레드 및 뮤텍스 지원
|
---|
7 | *
|
---|
8 | * @example thread.c
|
---|
9 | */
|
---|
10 | #ifndef __CF_THREAD_H__
|
---|
11 | #define __CF_THREAD_H__
|
---|
12 |
|
---|
13 | #include "cf_base.h"
|
---|
14 |
|
---|
15 | /** 스레드 워커 함수 형태이며, CF_Thread_Function 형식 */
|
---|
16 | typedef int (* CF_Thread_Function) (void *);
|
---|
17 |
|
---|
18 | /** 스레드 아이디 */
|
---|
19 | typedef void * CF_Thread;
|
---|
20 |
|
---|
21 | /** 뮤텍스 아이디 */
|
---|
22 | typedef void * CF_Mutex;
|
---|
23 |
|
---|
24 | #ifdef __cplusplus
|
---|
25 | extern "C" {
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | CF_EXPORT int
|
---|
29 | CF_Thread_Create (CF_Thread * threadID,
|
---|
30 | CF_Thread_Function callback,
|
---|
31 | void * arg);
|
---|
32 |
|
---|
33 | CF_EXPORT int
|
---|
34 | CF_Thread_Release (CF_Thread * threadID);
|
---|
35 |
|
---|
36 | CF_EXPORT int
|
---|
37 | CF_Thread_Join (CF_Thread * threadID);
|
---|
38 |
|
---|
39 | CF_EXPORT int
|
---|
40 | CF_Mutex_Create (CF_Mutex * mutex);
|
---|
41 |
|
---|
42 | CF_EXPORT int
|
---|
43 | CF_Mutex_Destory (CF_Mutex * mutex);
|
---|
44 |
|
---|
45 | CF_EXPORT int
|
---|
46 | CF_Mutex_Lock (CF_Mutex * mutex);
|
---|
47 |
|
---|
48 | CF_EXPORT int
|
---|
49 | CF_Mutex_Unlock (CF_Mutex * mutex);
|
---|
50 |
|
---|
51 | #ifdef __cplusplus
|
---|
52 | }
|
---|
53 | #endif
|
---|
54 |
|
---|
55 | #endif // #ifndef __CF_THREAD_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.