Skip to content

Commit

Permalink
[sgen] Don't use pthread_once() to init a TLS key, do it at GC init.
Browse files Browse the repository at this point in the history
  • Loading branch information
schani committed Jul 28, 2011
1 parent 5a35198 commit d3729e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mono/metadata/sgen-gc.c
Expand Up @@ -2040,9 +2040,6 @@ init_user_copy_or_mark_key (void)
static void
set_user_copy_or_mark_data (UserCopyOrMarkData *data)
{
static pthread_once_t init_control = PTHREAD_ONCE_INIT;
pthread_once (&init_control, init_user_copy_or_mark_key);

pthread_setspecific (user_copy_or_mark_key, data);
}

Expand Down Expand Up @@ -6590,6 +6587,8 @@ mono_gc_base_init (void)
LOCK_INIT (global_remset_mutex);
LOCK_INIT (pin_queue_mutex);

init_user_copy_or_mark_key ();

if ((env = getenv ("MONO_GC_PARAMS"))) {
opts = g_strsplit (env, ",", -1);
for (ptr = opts; *ptr; ++ptr) {
Expand Down

0 comments on commit d3729e9

Please sign in to comment.