src/thread/SDL_thread_c.h
changeset 7393 358696c354a8
parent 7011 82bbfbbc720e
child 7482 249d8ecbbb7d
--- a/src/thread/SDL_thread_c.h	Wed Jul 10 02:37:57 2013 -0700
+++ b/src/thread/SDL_thread_c.h	Wed Jul 10 18:31:17 2013 -0700
@@ -56,6 +56,30 @@
 /* This is the function called to run a thread */
 extern void SDL_RunThread(void *data);
 
+/* This is the system-independent thread local storage structure */
+typedef struct {
+    int limit;
+    struct {
+        void *data;
+        void (*destructor)(void*);
+    } array[1];
+} SDL_TLSData;
+
+/* This is how many TLS entries we allocate at once */
+#define TLS_ALLOC_CHUNKSIZE 4
+
+/* Get cross-platform, slow, thread local storage for this thread.
+   This is only intended as a fallback if getting real thread-local
+   storage fails or isn't supported on this platform.
+ */
+extern SDL_TLSData *SDL_Generic_GetTLSData();
+
+/* Set cross-platform, slow, thread local storage for this thread.
+   This is only intended as a fallback if getting real thread-local
+   storage fails or isn't supported on this platform.
+ */
+extern int SDL_Generic_SetTLSData(SDL_TLSData *data);
+
 #endif /* _SDL_thread_c_h */
 
 /* vi: set ts=4 sw=4 expandtab: */