GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
7
#ifndef __GF_TYPE_THREAD_H__
8
#define __GF_TYPE_THREAD_H__
9
10
#include <
gf_pre.h
>
11
#include <
gf_macro.h
>
12
13
#ifdef GF_EXPOSE_THREAD
14
typedef
struct
gf_thread_context_t
gf_thread_context_t
;
15
typedef
struct
gf_thread_t
gf_thread_t
;
16
17
/* External library */
18
#if defined(THREAD_POSIX)
19
#include <pthread.h>
20
#elif defined(THREAD_WIN32)
21
#include <windows.h>
22
#endif
23
24
/* Engine */
25
26
/* Standard */
27
39
GF_DECLARE_TYPE
(thread_context, {
40
void (*func)(
void
*);
41
void
* data;
42
});
43
44
#if defined(THREAD_POSIX)
45
GF_DECLARE_TYPE
(thread, {
46
gf_thread_context_t
context;
47
pthread_t thread;
48
});
49
#elif defined(THREAD_WIN32)
50
GF_DECLARE_TYPE
(thread, {
51
gf_thread_context_t
context;
52
HANDLE thread;
53
});
54
#else
61
GF_DECLARE_TYPE
(thread, {});
62
#endif
63
#else
64
typedef
void
gf_thread_t
;
65
typedef
void
gf_thread_context_t
;
66
#endif
67
68
#endif
gf_macro.h
Macro.
GF_DECLARE_TYPE
#define GF_DECLARE_TYPE(n, b)
Macro to define engine type shorter.
Definition
gf_macro.h:188
gf_pre.h
Required headers before anything.
gf_thread_context_t
Thread context.
Definition
thread.h:42
gf_thread_t
Platform-dependent thread.
Definition
thread.h:61
include
gf_type
thread.h
Generated by
1.9.8