src/thread/pthread/SDL_systls.c
changeset 10617 346c02ff71b6
parent 10609 d702ecbd8ba7
child 10737 3406a0f8b041
equal deleted inserted replaced
10616:d17dd08640a4 10617:346c02ff71b6
    30 
    30 
    31 static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY;
    31 static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY;
    32 static SDL_bool generic_local_storage = SDL_FALSE;
    32 static SDL_bool generic_local_storage = SDL_FALSE;
    33 
    33 
    34 SDL_TLSData *
    34 SDL_TLSData *
    35 SDL_SYS_GetTLSData()
    35 SDL_SYS_GetTLSData(void)
    36 {
    36 {
    37     if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {
    37     if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {
    38         static SDL_SpinLock lock;
    38         static SDL_SpinLock lock;
    39         SDL_AtomicLock(&lock);
    39         SDL_AtomicLock(&lock);
    40         if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {
    40         if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {