[io-layer] Extract error (#4279)
[mono.git] / mono / metadata / threadpool-io.c
index c7986ab0d60dd487d353f3b5cf5a0c1c1a6606d5..ace9a00bf6a8adb9bd83bcf6944f01bf84cfb882 100644 (file)
@@ -29,6 +29,7 @@
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-lazy-init.h>
 #include <mono/utils/mono-logger-internals.h>
+#include <mono/utils/w32api.h>
 
 typedef struct {
        gboolean (*init) (gint wakeup_pipe_fd);
@@ -305,7 +306,7 @@ wait_callback (gint fd, gint events, gpointer user_data)
        }
 }
 
-static void
+static gsize WINAPI
 selector_thread (gpointer data)
 {
        MonoError error;
@@ -315,7 +316,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 +431,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 */