X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsgen-mono.c;h=0ffea956f7fce324006748046e72fe2a828cdb0a;hb=08a728d237965feb2bbd485f909998b17c0bbb11;hp=ad3c31fdb65ad1c1ccb81a62c56017123a1b2ee6;hpb=36a31a578e18da5f9efdab9e7bc373bd7cfd8775;p=mono.git diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index ad3c31fdb65..0ffea956f7f 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -3,18 +3,7 @@ * * Copyright (C) 2014 Xamarin Inc * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License 2.0 as published by the Free Software Foundation; - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License 2.0 along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "config.h" @@ -37,6 +26,7 @@ #include "metadata/handle.h" #include "utils/mono-memory-model.h" #include "utils/mono-logger-internals.h" +#include "sgen/sgen-thread-pool.h" #ifdef HEAVY_STATISTICS static guint64 stat_wbarrier_set_arrayref = 0; @@ -2308,6 +2298,7 @@ void sgen_client_thread_register_worker (void) { mono_thread_info_register_small_id (); + mono_thread_info_set_name (mono_native_thread_id_get (), "SGen worker"); } /* Variables holding start/end nursery so it won't have to be passed at every call */ @@ -2946,9 +2937,14 @@ sgen_client_describe_invalid_pointer (GCObject *ptr) sgen_bridge_describe_pointer (ptr); } +static gboolean gc_inited; + void mono_gc_base_init (void) { + if (gc_inited) + return; + mono_counters_init (); #ifdef HEAVY_STATISTICS @@ -2971,11 +2967,14 @@ mono_gc_base_init (void) if (mono_tls_key_get_offset (TLS_KEY_SGEN_TLAB_NEXT_ADDR) == -1) sgen_set_use_managed_allocator (FALSE); #endif + + gc_inited = TRUE; } void mono_gc_base_cleanup (void) { + sgen_thread_pool_shutdown (); } gboolean