Skip to content

Commit a38bdc6

Browse files
committed
Add comment
1 parent 171f2ec commit a38bdc6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mono/metadata/threads.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,11 @@ create_internal_thread_object (void)
562562

563563
thread->apartment_state = ThreadApartmentState_Unknown;
564564
thread->managed_id = get_next_managed_thread_id ();
565-
#if !defined(HAVE_BOEHM_GC)
565+
/*
566+
* Boehm incremental is not actually "moving", it does not need the thread_pinning_ref.
567+
* But having it causes problems when unregistering the root after domain reload.
568+
*/
569+
#if !defined(HAVE_BOEHM_GC)
566570
if (mono_gc_is_moving ()) {
567571
thread->thread_pinning_ref = thread;
568572
MONO_GC_REGISTER_ROOT_PINNING (thread->thread_pinning_ref, MONO_ROOT_SOURCE_THREADING, NULL, "Thread Pinning Reference");
@@ -885,7 +889,11 @@ mono_thread_detach_internal (MonoInternalThread *thread)
885889
mono_thread_cleanup_fn (thread_get_tid (thread));
886890

887891
mono_memory_barrier ();
888-
892+
893+
/*
894+
* Boehm incremental is not actually "moving", it does not need the thread_pinning_ref.
895+
* But having it causes problems when unregistering the root after domain reload.
896+
*/
889897
#if !defined(HAVE_BOEHM_GC)
890898
if (mono_gc_is_moving ()) {
891899
MONO_GC_UNREGISTER_ROOT (thread->thread_pinning_ref);

0 commit comments

Comments
 (0)