src/thread/SDL_thread_c.h
changeset 7393 358696c354a8
parent 7011 82bbfbbc720e
child 7482 249d8ecbbb7d
     1.1 --- a/src/thread/SDL_thread_c.h	Wed Jul 10 02:37:57 2013 -0700
     1.2 +++ b/src/thread/SDL_thread_c.h	Wed Jul 10 18:31:17 2013 -0700
     1.3 @@ -56,6 +56,30 @@
     1.4  /* This is the function called to run a thread */
     1.5  extern void SDL_RunThread(void *data);
     1.6  
     1.7 +/* This is the system-independent thread local storage structure */
     1.8 +typedef struct {
     1.9 +    int limit;
    1.10 +    struct {
    1.11 +        void *data;
    1.12 +        void (*destructor)(void*);
    1.13 +    } array[1];
    1.14 +} SDL_TLSData;
    1.15 +
    1.16 +/* This is how many TLS entries we allocate at once */
    1.17 +#define TLS_ALLOC_CHUNKSIZE 4
    1.18 +
    1.19 +/* Get cross-platform, slow, thread local storage for this thread.
    1.20 +   This is only intended as a fallback if getting real thread-local
    1.21 +   storage fails or isn't supported on this platform.
    1.22 + */
    1.23 +extern SDL_TLSData *SDL_Generic_GetTLSData();
    1.24 +
    1.25 +/* Set cross-platform, slow, thread local storage for this thread.
    1.26 +   This is only intended as a fallback if getting real thread-local
    1.27 +   storage fails or isn't supported on this platform.
    1.28 + */
    1.29 +extern int SDL_Generic_SetTLSData(SDL_TLSData *data);
    1.30 +
    1.31  #endif /* _SDL_thread_c_h */
    1.32  
    1.33  /* vi: set ts=4 sw=4 expandtab: */