Set the name of some runtime threads.
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 10 Nov 2010 09:37:00 +0000 (10:37 +0100)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 10 Nov 2010 09:50:53 +0000 (10:50 +0100)
* gc.c: set the name of the finalizer thread.
* threadpool.c: set the name of the threadpool worker threads.

mono/metadata/gc.c
mono/metadata/threadpool.c

index 10f0976175b29712ae58367b838fcd04aead2b80..9d708638957e00180dcca64b4b40f6d33cfc8e3d 100644 (file)
@@ -1108,6 +1108,7 @@ mono_gc_init (void)
 #endif
 
        gc_thread = mono_thread_create_internal (mono_domain_get (), finalizer_thread, NULL, FALSE);
+       ves_icall_System_Threading_Thread_SetName_internal (gc_thread, mono_string_new (mono_domain_get (), "Finalizer"));
 }
 
 void
index ae687a62bd1a502d51802981e2b019d989d29b70..ba5f090bd4035e84acbf3809a4b57128416bf13f 100644 (file)
@@ -1253,6 +1253,7 @@ monitor_thread (gpointer data)
 
        tp = data;
        thread = mono_thread_internal_current ();
+       ves_icall_System_Threading_Thread_SetName_internal (thread, mono_string_new (mono_domain_get (), "Threapool monitor"));
        while (1) {
                ms = 500;
                do {
@@ -1935,6 +1936,7 @@ async_invoke_thread (gpointer data)
        thread = mono_thread_internal_current ();
 
        mono_profiler_thread_start (thread->tid);
+       ves_icall_System_Threading_Thread_SetName_internal (thread, mono_string_new (mono_domain_get (), "Threapool worker"));
 
        if (tp_start_func)
                tp_start_func (tp_hooks_user_data);