[threads] Remove useless indirection for thread creation on Posix platforms
authorLudovic Henry <ludovic.henry@xamarin.com>
Wed, 13 May 2015 19:16:28 +0000 (20:16 +0100)
committerLudovic Henry <ludovic.henry@xamarin.com>
Wed, 13 May 2015 22:08:15 +0000 (23:08 +0100)
mono/metadata/boehm-gc.c
mono/metadata/null-gc.c
mono/metadata/sgen-mono.c
mono/utils/gc_wrapper.h
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.h

index e62c554ca1e3a66e8fd0497041bde6f52ea1c4ff..efaa3ea1b114c3f1f8f2de3e62dd8341e6db425e 100644 (file)
@@ -217,7 +217,6 @@ mono_gc_base_init (void)
        cb.mono_method_is_critical = (gpointer)mono_runtime_is_critical_method;
 #ifndef HOST_WIN32
        cb.thread_exit = mono_gc_pthread_exit;
-       cb.mono_gc_pthread_create = (gpointer)mono_gc_pthread_create;
 #endif
        
        mono_threads_init (&cb, sizeof (MonoThreadInfo));
@@ -1249,12 +1248,6 @@ mono_gc_register_for_finalization (MonoObject *obj, void *user_data)
 
 #ifndef HOST_WIN32
 
-int
-mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
-{
-       return pthread_create (new_thread, attr, start_routine, arg);
-}
-
 int
 mono_gc_pthread_join (pthread_t thread, void **retval)
 {
index 1b3fa62221993ebb7fb6f4d3a2608a43e1734cda..610cf2de23a50b166872c1c86c20d8b8daaafc0a 100644 (file)
@@ -30,7 +30,6 @@ mono_gc_base_init (void)
                 manner that boehm-gc does it. This is probably worth investigating
                 more carefully. */
        cb.mono_method_is_critical = (gpointer)mono_runtime_is_critical_method;
-       cb.mono_gc_pthread_create = (gpointer)mono_gc_pthread_create;
        cb.thread_exit = mono_gc_pthread_exit;
 
        mono_threads_init (&cb, sizeof (MonoThreadInfo));
@@ -445,12 +444,6 @@ mono_gc_make_root_descr_user (MonoGCRootMarkFunc marker)
 
 #ifndef HOST_WIN32
 
-int
-mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
-{
-       return pthread_create (new_thread, attr, start_routine, arg);
-}
-
 int
 mono_gc_pthread_join (pthread_t thread, void **retval)
 {
index 575b5d26edb18d7375098109282e818e7cfc9f28..b4a0009eafd5f86ce05596de9e72ccd31762abd6 100644 (file)
@@ -2367,12 +2367,6 @@ mono_gc_deregister_root (char* addr)
 
 #if USE_PTHREAD_INTERCEPT
 
-int
-mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
-{
-       return pthread_create (new_thread, attr, start_routine, arg);
-}
-
 int
 mono_gc_pthread_join (pthread_t thread, void **retval)
 {
@@ -2706,7 +2700,6 @@ sgen_client_init (void)
        cb.mono_thread_in_critical_region = thread_in_critical_region;
 #ifndef HOST_WIN32
        cb.thread_exit = mono_gc_pthread_exit;
-       cb.mono_gc_pthread_create = (gpointer)mono_gc_pthread_create;
 #endif
 
        mono_threads_init (&cb, sizeof (SgenThreadInfo));
index 504e59937c90fdca6f039b6ba44c36dd9ddb22ec..797056b4f8f67e35dbd855db40905cece23a8813 100644 (file)
@@ -70,7 +70,6 @@
 /* pthread function wrappers */
 #include <pthread.h>
 
-int mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
 int mono_gc_pthread_join (pthread_t thread, void **retval);
 int mono_gc_pthread_detach (pthread_t thread);
 void mono_gc_pthread_exit (void *retval) G_GNUC_NORETURN;
index b74bf6448705c17ba613ecc7cd151ffe9c8ea52c..4f503d38a95f036faef1c308c1137e887689003d 100644 (file)
@@ -152,7 +152,7 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer
        MONO_SEM_INIT (&(start_info.registered), 0);
 
        /* Actually start the thread */
-       res = mono_threads_get_callbacks ()->mono_gc_pthread_create (&thread, &attr, inner_start_thread, &start_info);
+       res = pthread_create (&thread, &attr, inner_start_thread, &start_info);
        if (res) {
                MONO_SEM_DESTROY (&(start_info.registered));
                return NULL;
index 54f3e8b63d458c80d39374e85c4a59ab54397062..16335ce2f492198c842a6275413c359754fcd6b4 100644 (file)
@@ -265,9 +265,6 @@ typedef struct {
        gboolean (*mono_method_is_critical) (void *method);
        gboolean (*mono_thread_in_critical_region) (THREAD_INFO_TYPE *info);
        void (*thread_exit)(void *retval);
-#ifndef HOST_WIN32
-       int (*mono_gc_pthread_create) (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
-#endif
 } MonoThreadInfoCallbacks;
 
 typedef struct {