Merge pull request #2880 from kumpera/fix_5644
[mono.git] / mono / metadata / threadpool-ms-io.c
index 30e34e50a3c5bcdd5dc096fd8154953cafd9c690..2851c7547b8b859f8b296c56cba264bf842ca4c7 100644 (file)
@@ -5,6 +5,7 @@
  *     Ludovic Henry (ludovic.henry@xamarin.com)
  *
  * Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
@@ -31,7 +32,6 @@
 
 typedef struct {
        gboolean (*init) (gint wakeup_pipe_fd);
-       void     (*cleanup) (void);
        void     (*register_fd) (gint fd, gint events, gboolean is_new);
        void     (*remove_fd) (gint fd);
        gint     (*event_wait) (void (*callback) (gint fd, gint events, gpointer user_data), gpointer user_data);
@@ -550,24 +550,6 @@ cleanup (void)
        selector_thread_wakeup ();
        while (io_selector_running)
                mono_thread_info_usleep (1000);
-
-       mono_coop_mutex_destroy (&threadpool_io->updates_lock);
-       mono_coop_cond_destroy (&threadpool_io->updates_cond);
-
-       threadpool_io->backend.cleanup ();
-
-#if !defined(HOST_WIN32)
-       close (threadpool_io->wakeup_pipes [0]);
-       close (threadpool_io->wakeup_pipes [1]);
-#else
-       closesocket (threadpool_io->wakeup_pipes [0]);
-       closesocket (threadpool_io->wakeup_pipes [1]);
-#endif
-
-       g_assert (threadpool_io);
-       g_free (threadpool_io);
-       threadpool_io = NULL;
-       g_assert (!threadpool_io);
 }
 
 void
@@ -583,7 +565,7 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job)
 
        g_assert (handle >= 0);
 
-       g_assert (job->operation == EVENT_IN ^ job->operation == EVENT_OUT);
+       g_assert ((job->operation == EVENT_IN) ^ (job->operation == EVENT_OUT));
        g_assert (job->callback);
 
        if (mono_runtime_is_shutting_down ())