[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-audio-dev
Subject:    [Audio-dev] CR-Client: name client threads
From:       "Eric Hyche" <ehyche () real ! com>
Date:       2006-01-19 16:22:49
Message-ID: 1380.24.158.105.201.1137687769.squirrel () scarface ! real ! com
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


Description
--------------------------------
We recently added the ability to name threads so that
when running in a debugger the name of the thread shows up
instead of just the default starting routine. Now that we
have that ability, we now apply names to several of the threads
that the client core creates. Threads that use the
cross-platform HXThread class use HXThread::SetThreadName()
and Win32-specific threads use SetDebuggerThreadName().

Files Modified
--------------------------------
audio/device/auddevlib_win.pcf
audio/device/platform/win/hxaudevds.cpp
client/common/netio/platform/win/hxnetif.cpp
client/common/system/casyntim.cpp
common/log/logsystem/hxtdeliverymanager.cpp
common/netio/threngin.cpp
common/util/hxtaskmanager.cpp
common/util/hxthreadtaskdriver.cpp
video/sitelib/platform/win/winsurf2.cpp

Branches
--------------------------------
HEAD only

===========================================
Eric Hyche (ehyche@real.com)
Embedded Player and Technologies
RealNetworks, Inc.
["naming-client-threads-diff.txt" (text/plain)]

Index: auddevlib_win.pcf
===================================================================
RCS file: /cvsroot/audio/device/auddevlib_win.pcf,v
retrieving revision 1.5
diff -u -w -r1.5 auddevlib_win.pcf
--- auddevlib_win.pcf	5 Sep 2005 12:24:50 -0000	1.5
+++ auddevlib_win.pcf	19 Jan 2006 16:09:26 -0000
@@ -42,6 +42,7 @@
     if "HELIX_FEATURE_DIRECT_SOUND" in project.defines:
         project.AddIncludes(GetSDKPath("dxsdk") + "/include")
         project.AddSources("platform/win/hxaudevds.cpp")
+        project.AddModuleIncludes("common/system/pub/platform/win")
     else:
         project.AddSources("platform/win/winaudio.cpp")
 else:
@@ -49,4 +50,5 @@
     if "HELIX_FEATURE_DIRECT_SOUND" in project.defines:
         project.AddIncludes(GetSDKPath("dxsdk") + "/include")
         project.AddSources("platform/win/hxaudevds.cpp");
+        project.AddModuleIncludes("common/system/pub/platform/win")
     
Index: platform/win/hxaudevds.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/win/hxaudevds.cpp,v
retrieving revision 1.29
diff -u -w -r1.29 hxaudevds.cpp
--- platform/win/hxaudevds.cpp	24 Jun 2005 23:39:30 -0000	1.29
+++ platform/win/hxaudevds.cpp	19 Jan 2006 16:09:27 -0000
@@ -78,6 +78,7 @@
 #include "tsconvrt.h"
 
 #include "hxaudevds.h"
+#include "set_debugger_thread_name.h"
 
 #include <initguid.h>
 #include "HXAudioDeviceHook/HXAudioDeviceHook.h"
@@ -429,6 +430,7 @@
 	    delete[] aPositionNotify;
 	    DWORD dwWaitThreadID(0);
 	    m_hWaitThread = CreateThread(NULL, 0, EventThreadProc, (LPVOID)this, 0, &dwWaitThreadID);
+            SetDebuggerThreadName(dwWaitThreadID, "DirectSound Audio Device Thread");
 	    SetThreadPriority( m_hWaitThread, THREAD_PRIORITY_HIGHEST );
 	}
 	HX_RELEASE(pNotify);
Index: platform/win/hxnetif.cpp
===================================================================
RCS file: /cvsroot/client/common/netio/platform/win/hxnetif.cpp,v
retrieving revision 1.20
diff -u -w -r1.20 hxnetif.cpp
--- platform/win/hxnetif.cpp	29 Jun 2005 23:20:13 -0000	1.20
+++ platform/win/hxnetif.cpp	19 Jan 2006 16:10:29 -0000
@@ -203,6 +203,10 @@
             if (HXR_OK == rc)
             {
 	        rc = m_pThread->CreateThread(NIThreadRoutine, (void*) this);
+                if (SUCCEEDED(rc))
+                {
+                    m_pThread->SetThreadName("Net Interface Change Thread");
+                }
             }
         }
         else
Index: casyntim.cpp
===================================================================
RCS file: /cvsroot/client/common/system/casyntim.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 casyntim.cpp
--- casyntim.cpp	14 Mar 2005 20:28:54 -0000	1.7
+++ casyntim.cpp	19 Jan 2006 16:10:40 -0000
@@ -118,6 +118,10 @@
     if (!theErr)
     {
 	theErr = m_pThread->CreateThread(ThreadRoutine2, (void*) this);
+        if (SUCCEEDED(theErr))
+        {
+            m_pThread->SetThreadName("Asynchronous Timer Thread");
+        }
     }
 
     return theErr;
Index: hxtdeliverymanager.cpp
===================================================================
RCS file: /cvsroot/common/log/logsystem/hxtdeliverymanager.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 hxtdeliverymanager.cpp
--- hxtdeliverymanager.cpp	26 Apr 2005 23:02:37 -0000	1.5
+++ hxtdeliverymanager.cpp	19 Jan 2006 16:11:05 -0000
@@ -212,6 +212,10 @@
         if (SUCCEEDED(res))
         {
             res = m_pDeliveryThread->CreateThread(DeliveryThread_, this);
+            if (SUCCEEDED(res))
+            {
+                m_pDeliveryThread->SetThreadName("Logging System Delivery Thread");
+            }
         }
 
     }
Index: threngin.cpp
===================================================================
RCS file: /cvsroot/common/netio/threngin.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 threngin.cpp
--- threngin.cpp	14 Mar 2005 19:36:35 -0000	1.7
+++ threngin.cpp	19 Jan 2006 16:11:19 -0000
@@ -128,6 +128,7 @@
 #endif
 
     m_pNetworkThread->CreateThread(NetworkThreadMainLoop, (void*) this);
+    m_pNetworkThread->SetThreadName("Old NetServices Network Thread");
     m_pSockMap = new CHXMapPtrToPtr;
     
     /* This is just a wrapper thread for the main application 
Index: hxtaskmanager.cpp
===================================================================
RCS file: /cvsroot/common/util/hxtaskmanager.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 hxtaskmanager.cpp
--- hxtaskmanager.cpp	11 Mar 2005 01:56:42 -0000	1.7
+++ hxtaskmanager.cpp	19 Jan 2006 16:11:30 -0000
@@ -278,6 +278,7 @@
         hr = pThread->CreateThread(TaskThreadProc_, this);
         if(SUCCEEDED(hr))
         {
+            pThread->SetThreadName("HXTaskManager Thread");
             hr = pThread->SetPriority(threadPriority);
         }
 
Index: hxthreadtaskdriver.cpp
===================================================================
RCS file: /cvsroot/common/util/hxthreadtaskdriver.cpp,v
retrieving revision 1.8
diff -u -w -r1.8 hxthreadtaskdriver.cpp
--- hxthreadtaskdriver.cpp	9 Aug 2005 03:05:03 -0000	1.8
+++ hxthreadtaskdriver.cpp	19 Jan 2006 16:11:30 -0000
@@ -164,6 +164,8 @@
         goto exit;
     }
 
+    m_pDriverThread->SetThreadName("HXThreadTaskDriver Thread");
+
     hr = SetThreadPriority(threadPriority);
     if (FAILED(hr))
     {
Index: platform/win/winsurf2.cpp
===================================================================
RCS file: /cvsroot/video/sitelib/platform/win/winsurf2.cpp,v
retrieving revision 1.32
diff -u -w -r1.32 winsurf2.cpp
--- platform/win/winsurf2.cpp	17 Nov 2005 00:02:11 -0000	1.32
+++ platform/win/winsurf2.cpp	19 Jan 2006 16:12:07 -0000
@@ -69,6 +69,7 @@
 #include "hxheap.h"
 #include "hxevent.h"
 #include "hwmemobj.h"
+#include "set_debugger_thread_name.h"
 
 
 // these are defined in basesurf.cpp and should probably be moved to a .h file
@@ -962,6 +963,8 @@
     m_hRenThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE )ThreadProc,
                                 this, 0, &dwId);
 
+    SetDebuggerThreadName(dwId, "Video Surface 2 Rendering Thread");
+
     if (m_bBoostRenderThread)
         SetThreadPriority(m_hRenThread, THREAD_PRIORITY_TIME_CRITICAL);
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic