[io-layer] Remove unused _WAPI_THREAD_CURRENT
authorLudovic Henry <ludovic@xamarin.com>
Fri, 15 Jul 2016 01:55:42 +0000 (03:55 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 4 Aug 2016 13:41:46 +0000 (15:41 +0200)
mono/io-layer/thread-private.h
mono/io-layer/wait.c
mono/io-layer/wapi.c

index c5bb6cf3dfba4cabf2f982c9f77c2ec16f64d9bc..e9ff31e9aed1637a9d3b1253cc1a7e73d1a4aab1 100644 (file)
@@ -16,9 +16,6 @@
 
 #include "wapi-private.h"
 
-/* There doesn't seem to be a defined symbol for this */
-#define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE
-
 void
 _wapi_thread_init (void);
 
index 7674aef01efc7f58f710cefea1bc15e1d5b6fd0b..9d9f34abc8c73fb28bf3f19cca277edb1188ba20 100644 (file)
@@ -69,15 +69,8 @@ guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout,
        guint32 ret, waited;
        int thr_ret;
        gboolean apc_pending = FALSE;
-       gpointer current_thread;
        gint64 wait_start, timeout_in_ticks;
 
-       current_thread = mono_thread_info_get_handle (mono_thread_info_current ());
-
-       if (handle == _WAPI_THREAD_CURRENT) {
-               handle = current_thread;
-       }
-
        if ((GPOINTER_TO_UINT (handle) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED) {
                SetLastError (ERROR_INVALID_HANDLE);
                return(WAIT_FAILED);
@@ -243,19 +236,8 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
        guint32 ret = 0, waited;
        int thr_ret;
        gboolean apc_pending = FALSE;
-       gpointer current_thread;
        gint64 wait_start, timeout_in_ticks;
 
-       current_thread = mono_thread_info_get_handle (mono_thread_info_current ());
-
-       if (signal_handle == _WAPI_THREAD_CURRENT) {
-               signal_handle = current_thread;
-       }
-
-       if (wait == _WAPI_THREAD_CURRENT) {
-               wait = current_thread;
-       }
-
        if ((GPOINTER_TO_UINT (signal_handle) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED) {
                SetLastError (ERROR_INVALID_HANDLE);
                return(WAIT_FAILED);
@@ -435,15 +417,12 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
        guint i;
        guint32 ret;
        int thr_ret;
-       gpointer current_thread;
        guint32 retval;
        gboolean poll;
        gpointer sorted_handles [MAXIMUM_WAIT_OBJECTS];
        gboolean apc_pending = FALSE;
        gint64 wait_start, timeout_in_ticks;
        
-       current_thread = mono_thread_info_get_handle (mono_thread_info_current ());
-
        if (numobjects > MAXIMUM_WAIT_OBJECTS) {
                MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Too many handles: %d", __func__, numobjects);
 
@@ -456,10 +435,6 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
 
        /* Check for duplicates */
        for (i = 0; i < numobjects; i++) {
-               if (handles[i] == _WAPI_THREAD_CURRENT) {
-                       handles[i] = current_thread;
-               }
-
                if ((GPOINTER_TO_UINT (handles[i]) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED) {
                        MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Handle %d pseudo process", __func__,
                                   i);
index 5ab47ac9bc6484b1e5d4a38ebc64c3f04f118abe..da38a1449277bd25bdff7a73be0def6f9c335c90 100644 (file)
@@ -143,8 +143,6 @@ DuplicateHandle (gpointer srcprocess, gpointer src, gpointer targetprocess, gpoi
 
        if (src == _WAPI_PROCESS_CURRENT) {
                *target = _wapi_process_duplicate ();
-       } else if (src == _WAPI_THREAD_CURRENT) {
-               g_assert_not_reached ();
        } else {
                mono_w32handle_ref (src);
                *target = src;