mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
SDL API renaming: SDL TLS functions
Fixes https://github.com/libsdl-org/SDL/issues/7743
This commit is contained in:
@@ -58,9 +58,9 @@ ThreadFunc(void *data)
|
||||
{
|
||||
SDL_ThreadPriority prio = SDL_THREAD_PRIORITY_NORMAL;
|
||||
|
||||
SDL_TLSSet(tls, "baby thread", NULL);
|
||||
SDL_SetTLS(tls, "baby thread", NULL);
|
||||
SDL_Log("Started thread %s: My thread id is %lu, thread data = %s\n",
|
||||
(char *)data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls));
|
||||
(char *)data, SDL_ThreadID(), (const char *)SDL_GetTLS(tls));
|
||||
while (alive) {
|
||||
SDL_Log("Thread '%s' is alive!\n", (char *)data);
|
||||
|
||||
@@ -132,10 +132,10 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
tls = SDL_TLSCreate();
|
||||
tls = SDL_CreateTLS();
|
||||
SDL_assert(tls);
|
||||
SDL_TLSSet(tls, "main thread", NULL);
|
||||
SDL_Log("Main thread data initially: %s\n", (const char *)SDL_TLSGet(tls));
|
||||
SDL_SetTLS(tls, "main thread", NULL);
|
||||
SDL_Log("Main thread data initially: %s\n", (const char *)SDL_GetTLS(tls));
|
||||
|
||||
alive = 1;
|
||||
thread = SDL_CreateThread(ThreadFunc, "One", "#1");
|
||||
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
|
||||
alive = 0;
|
||||
SDL_WaitThread(thread, NULL);
|
||||
|
||||
SDL_Log("Main thread data finally: %s\n", (const char *)SDL_TLSGet(tls));
|
||||
SDL_Log("Main thread data finally: %s\n", (const char *)SDL_GetTLS(tls));
|
||||
|
||||
alive = 1;
|
||||
(void)signal(SIGTERM, killed);
|
||||
|
||||
Reference in New Issue
Block a user