zenilib  0.5.3.0
 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
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
37 #elif SDL_THREAD_WINDOWS
39 #elif SDL_THREAD_PSP
40 #include "psp/SDL_systhread_c.h"
41 #else
42 #error Need thread implementation for this platform
44 #endif
45 #include "../SDL_error_c.h"
46 
47 /* This is the system-independent thread info structure */
48 struct SDL_Thread
49 {
52  int status;
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  */
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  */
84 
85 #endif /* _SDL_thread_c_h */
86 
87 /* vi: set ts=4 sw=4 expandtab: */
char * name
Definition: SDL_thread_c.h:54
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
unsigned long SDL_threadID
Definition: SDL_thread.h:49
SDL_TLSData * SDL_Generic_GetTLSData()
Definition: SDL_thread.c:122
void * data
Definition: SDL_thread_c.h:65
int SDL_Generic_SetTLSData(SDL_TLSData *storage)
Definition: SDL_thread.c:161
unsigned int limit
Definition: SDL_thread_c.h:63
SDL_error errbuf
Definition: SDL_thread_c.h:53
SDL_threadID threadid
Definition: SDL_thread_c.h:50
thread_id SYS_ThreadHandle
GLenum array
Definition: glew.h:8327
void * data
Definition: SDL_thread_c.h:55
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl2ext.h:848
SYS_ThreadHandle handle
Definition: SDL_thread_c.h:51
void SDL_RunThread(void *data)
Definition: SDL_thread.c:263