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
/* External library */
15
#if defined(THREAD_POSIX)
16
#include <pthread.h>
17
#elif defined(THREAD_WIN32)
18
#include <windows.h>
19
#endif
20
21
/* Engine */
22
23
/* Standard */
24
36
GF_DECLARE_TYPE
(thread_context, {
37
void (*func)(
void
*);
38
void
* data;
39
});
40
41
#if defined(THREAD_POSIX)
42
GF_DECLARE_TYPE
(thread, {
43
gf_thread_context_t
context;
44
pthread_t thread;
45
});
46
#elif defined(THREAD_WIN32)
47
GF_DECLARE_TYPE
(thread, {
48
gf_thread_context_t
context;
49
HANDLE thread;
50
});
51
#else
58
GF_DECLARE_TYPE
(thread, {});
59
#endif
60
#else
61
typedef
void
gf_thread_t
;
62
typedef
void
gf_thread_context_t
;
63
#endif
64
65
#endif
gf_macro.h
Macro.
GF_DECLARE_TYPE
#define GF_DECLARE_TYPE(n, b)
Macro to define engine type shorter.
Definition
gf_macro.h:164
gf_pre.h
Required headers before anything.
gf_thread_context_t
Thread context.
Definition
thread.h:39
gf_thread_t
Platform-dependent thread.
Definition
thread.h:58
include
gf_type
thread.h
Generated by
1.9.8