[runtime] Fix prototype of functions
authorVlad Brezae <brezaevlad@gmail.com>
Tue, 29 Nov 2016 19:06:13 +0000 (21:06 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Tue, 13 Dec 2016 18:44:04 +0000 (20:44 +0200)
These functions are cast and invoked as a MonoThreadStart (which requires to receive on arg, return one arg and be WINAPI on windwos), which could lead to cconv problems if the prototype is not matching.

mono/metadata/gc.c
mono/metadata/threadpool-io.c
mono/metadata/threadpool-worker-default.c

index ad9db931df428edd30bfffedd5e63f56cd75c334..3a694a4b8e95867c7d7db2d90758f49df13b6423 100644 (file)
@@ -42,6 +42,7 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/utils/hazard-pointer.h>
+#include <mono/io-layer/io-layer.h>
 
 #ifndef HOST_WIN32
 #include <pthread.h>
@@ -882,7 +883,7 @@ finalize_domain_objects (void)
        }
 }
 
-static guint32
+static gsize WINAPI
 finalizer_thread (gpointer unused)
 {
        MonoError error;
index c7986ab0d60dd487d353f3b5cf5a0c1c1a6606d5..00b7e466933ce00e2dcf0fe0f7790d7f85e798c4 100644 (file)
@@ -305,7 +305,7 @@ wait_callback (gint fd, gint events, gpointer user_data)
        }
 }
 
-static void
+static gsize WINAPI
 selector_thread (gpointer data)
 {
        MonoError error;
@@ -315,7 +315,7 @@ selector_thread (gpointer data)
 
        if (mono_runtime_is_shutting_down ()) {
                io_selector_running = FALSE;
-               return;
+               return 0;
        }
 
        states = mono_g_hash_table_new_type (g_direct_hash, g_direct_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_THREAD_POOL, "i/o thread pool states table");
@@ -430,6 +430,8 @@ selector_thread (gpointer data)
        mono_g_hash_table_destroy (states);
 
        io_selector_running = FALSE;
+
+       return 0;
 }
 
 /* Locking: threadpool_io->updates_lock must be held */
index 3e39c57c7561ca391265341f1305ab5c4b431fd2..89f159d6651ab3c8a60846b7b46c804487a69a74 100644 (file)
@@ -539,7 +539,7 @@ worker_try_unpark (MonoThreadPoolWorker *worker)
        return res;
 }
 
-static void
+static gsize WINAPI
 worker_thread (gpointer data)
 {
        MonoThreadPoolWorker *worker;
@@ -759,7 +759,7 @@ monitor_sufficient_delay_since_last_dequeue (MonoThreadPoolWorker *worker)
 
 static void hill_climbing_force_change (MonoThreadPoolWorker *worker, gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition);
 
-static void
+static gsize WINAPI
 monitor_thread (gpointer data)
 {
        MonoThreadPoolWorker *worker;