foxygit / doom Log in
commit 7fd60f8d9b7e5930f34b9cb105082f9e40896f22
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Fri Nov 28 15:43:26 2014 -0500
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Fri Nov 28 15:43:26 2014 -0500

    Add thread name to SDL_CreateThread calls.

    SDL2's version of SDL_CreateThread has an extra parameter to specify
    a name for the thread.
---
 opl/opl_timer.c         | 2 +-
 pcsound/pcsound_bsd.c   | 3 ++-
 pcsound/pcsound_linux.c | 5 +++--
 pcsound/pcsound_win32.c | 3 ++-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/opl/opl_timer.c b/opl/opl_timer.c
index 312fe7fa..2c4ce273 100644
--- a/opl/opl_timer.c
+++ b/opl/opl_timer.c
@@ -184,7 +184,7 @@ int OPL_Timer_StartThread(void)
     opl_timer_paused = 0;
     pause_offset = 0;

-    timer_thread = SDL_CreateThread(ThreadFunction, NULL);
+    timer_thread = SDL_CreateThread(ThreadFunction, "OPL timer thread", NULL);

     if (timer_thread == NULL)
     {
diff --git a/pcsound/pcsound_bsd.c b/pcsound/pcsound_bsd.c
index 4e1252d1..a3055e7d 100644
--- a/pcsound/pcsound_bsd.c
+++ b/pcsound/pcsound_bsd.c
@@ -291,7 +291,8 @@ static int PCSound_BSD_Init(pcsound_callback_func callback_func)
     }

     sound_thread_running = 1;
-    sound_thread_handle = SDL_CreateThread(SoundThread, NULL);
+    sound_thread_handle =
+        SDL_CreateThread(SoundThread, "PC speaker thread", NULL);

     return 1;
 }
diff --git a/pcsound/pcsound_linux.c b/pcsound/pcsound_linux.c
index 754480cc..b8a5bbca 100644
--- a/pcsound/pcsound_linux.c
+++ b/pcsound/pcsound_linux.c
@@ -142,8 +142,9 @@ static int PCSound_Linux_Init(pcsound_callback_func callback_func)
     callback = callback_func;
     sound_thread_running = 1;

-    sound_thread_handle = SDL_CreateThread(SoundThread, NULL);
-
+    sound_thread_handle =
+        SDL_CreateThread(SoundThread, "PC speaker thread", NULL);
+
     return 1;
 }

diff --git a/pcsound/pcsound_win32.c b/pcsound/pcsound_win32.c
index c2ba506a..136d9d56 100644
--- a/pcsound/pcsound_win32.c
+++ b/pcsound/pcsound_win32.c
@@ -87,7 +87,8 @@ static int PCSound_Win32_Init(pcsound_callback_func callback_func)
     callback = callback_func;
     sound_thread_running = 1;

-    sound_thread_handle = SDL_CreateThread(SoundThread, NULL);
+    sound_thread_handle =
+        SDL_CreateThread(SoundThread, "PC speaker thread", NULL);

     return 1;
 }