src/thread/generic/SDL_systls.c
author Sam Lantinga <slouken@libsdl.org>
Wed, 10 Jul 2013 18:31:17 -0700
changeset 7393 358696c354a8
parent 7391 a29895dc5e9a
child 8093 b43765095a6f
permissions -rw-r--r--
Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
slouken@7391
     1
/*
slouken@7391
     2
  Simple DirectMedia Layer
slouken@7391
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
slouken@7391
     4
slouken@7391
     5
  This software is provided 'as-is', without any express or implied
slouken@7391
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@7391
     7
  arising from the use of this software.
slouken@7391
     8
slouken@7391
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@7391
    10
  including commercial applications, and to alter it and redistribute it
slouken@7391
    11
  freely, subject to the following restrictions:
slouken@7391
    12
slouken@7391
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@7391
    14
     claim that you wrote the original software. If you use this software
slouken@7391
    15
     in a product, an acknowledgment in the product documentation would be
slouken@7391
    16
     appreciated but is not required.
slouken@7391
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@7391
    18
     misrepresented as being the original software.
slouken@7391
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@7391
    20
*/
slouken@7391
    21
slouken@7391
    22
#include "SDL_config.h"
slouken@7393
    23
#include "../SDL_thread_c.h"
slouken@7391
    24
slouken@7391
    25
slouken@7393
    26
SDL_TLSData *
slouken@7393
    27
SDL_SYS_GetTLSData()
slouken@7391
    28
{
slouken@7393
    29
    return SDL_Generic_GetTLSData();
slouken@7391
    30
}
slouken@7391
    31
slouken@7391
    32
int
slouken@7393
    33
SDL_SYS_SetTLSData(SDL_TLSData *data)
slouken@7391
    34
{
slouken@7393
    35
    return SDL_Generic_SetTLSData(data);
slouken@7391
    36
}
slouken@7391
    37
slouken@7391
    38
/* vi: set ts=4 sw=4 expandtab: */