zenilib: zenilib/jni/external/sdl/src/thread/SDL_thread_c.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_thread_c.h
Go to the documentation of this file.
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "SDL_config.h"
22
23 #ifndef _SDL_thread_c_h
24 #define _SDL_thread_c_h
25
26 #include "SDL_thread.h"
27
28 /* Need the definitions of SYS_ThreadHandle */
29 #if SDL_THREADS_DISABLED
30 #include "generic/SDL_systhread_c.h"
31 #elif SDL_THREAD_BEOS
32 #include "beos/SDL_systhread_c.h"
33 #elif SDL_THREAD_EPOC
34 #include "epoc/SDL_systhread_c.h"
35 #elif SDL_THREAD_PTHREAD
36 #include "pthread/SDL_systhread_c.h"
37 #elif SDL_THREAD_WINDOWS
38 #include "windows/SDL_systhread_c.h"
39 #elif SDL_THREAD_PSP
40 #include "psp/SDL_systhread_c.h"
41 #else
42 #error Need thread implementation for this platform
43 #include "generic/SDL_systhread_c.h"
44 #endif
45 #include "../SDL_error_c.h"
46
47 /* This is the system-independent thread info structure */
48 struct SDL_Thread
49 {
50 SDL_threadID threadid;
51 SYS_ThreadHandle handle;
52 int status;
53 SDL_error errbuf;
54 char *name;
55 void *data;
56 };
57
58 /* This is the function called to run a thread */
59 extern void SDL_RunThread(void *data);
60
61 /* This is the system-independent thread local storage structure */
62 typedef struct {
63 unsigned int limit;
64 struct {
65 void *data;
66 void (*destructor)(void*);
67 } array[1];
68 } SDL_TLSData;
69
70 /* This is how many TLS entries we allocate at once */
71 #define TLS_ALLOC_CHUNKSIZE 4
72
73 /* Get cross-platform, slow, thread local storage for this thread.
74 This is only intended as a fallback if getting real thread-local
75 storage fails or isn't supported on this platform.
76 */
77 extern SDL_TLSData *SDL_Generic_GetTLSData();
78
79 /* Set cross-platform, slow, thread local storage for this thread.
80 This is only intended as a fallback if getting real thread-local
81 storage fails or isn't supported on this platform.
82 */
83 extern int SDL_Generic_SetTLSData(SDL_TLSData *data);
84
85 #endif /* _SDL_thread_c_h */
86
87 /* vi: set ts=4 sw=4 expandtab: */
SDL_systhread_c.h
SDL_Thread::name
char * name
Definition: SDL_thread_c.h:54
SDL_systhread_c.h
void
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
SDL_threadID
unsigned long SDL_threadID
Definition: SDL_thread.h:49
SDL_Generic_GetTLSData
SDL_TLSData * SDL_Generic_GetTLSData()
Definition: SDL_thread.c:122
SDL_TLSData::data
void * data
Definition: SDL_thread_c.h:65
SDL_Generic_SetTLSData
int SDL_Generic_SetTLSData(SDL_TLSData *storage)
Definition: SDL_thread.c:161
SDL_TLSData
Definition: SDL_thread_c.h:62
SDL_TLSData::limit
unsigned int limit
Definition: SDL_thread_c.h:63
SDL_error
Definition: SDL_error_c.h:33
SDL_Thread::errbuf
SDL_error errbuf
Definition: SDL_thread_c.h:53
SDL_Thread::threadid
SDL_threadID threadid
Definition: SDL_thread_c.h:50
SDL_Thread::status
int status
Definition: SDL_thread_c.h:52
SYS_ThreadHandle
thread_id SYS_ThreadHandle
Definition: SDL_systhread_c.h:26
SDL_config.h
array
GLenum array
Definition: glew.h:8327
SDL_Thread::data
void * data
Definition: SDL_thread_c.h:55
SDL_systhread_c.h
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl2ext.h:848
SDL_systhread_c.h
SDL_Thread::handle
SYS_ThreadHandle handle
Definition: SDL_thread_c.h:51
SDL_systhread_c.h
SDL_RunThread
void SDL_RunThread(void *data)
Definition: SDL_thread.c:263
SDL_Thread
Definition: SDL_thread_c.h:48