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

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

#1 fix thread interface

File size: 989 bytes
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 형식 */
16typedef int (* CF_Thread_Function) (void *);
17
18/** 스레드 아이디 */
19typedef void * CF_Thread;
20
21/** 뮤텍스 아이디 */
22typedef void * CF_Mutex;
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28CF_EXPORT int
29CF_Thread_Create (CF_Thread * threadID,
30 CF_Thread_Function callback,
31 void * arg);
32
33CF_EXPORT int
34CF_Thread_Release (CF_Thread * threadID);
35
36CF_EXPORT int
37CF_Thread_Join (CF_Thread * threadID);
38
39CF_EXPORT int
40CF_Mutex_Create (CF_Mutex * mutex);
41
42CF_EXPORT int
43CF_Mutex_Destory (CF_Mutex * mutex);
44
45CF_EXPORT int
46CF_Mutex_Lock (CF_Mutex * mutex);
47
48CF_EXPORT int
49CF_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.