[io-layer] Extract socket (#4241)
[mono.git] / mono / metadata / appdomain.c
index a571f676b455dd25ba9710505e52c5ae822651db..74323ab37b36e9a6fc94a85a049c4c2910d3ce3e 100644 (file)
@@ -42,8 +42,7 @@
 #include <mono/metadata/exception.h>
 #include <mono/metadata/exception-internals.h>
 #include <mono/metadata/threads.h>
-#include <mono/metadata/threadpool-ms.h>
-#include <mono/metadata/socket-io.h>
+#include <mono/metadata/threadpool.h>
 #include <mono/metadata/tabledefs.h>
 #include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-gc.h>
@@ -60,6 +59,7 @@
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/reflection-internals.h>
 #include <mono/metadata/abi-details.h>
+#include <mono/metadata/w32socket.h>
 #include <mono/utils/mono-uri.h>
 #include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-path.h>
@@ -1815,6 +1815,11 @@ mono_domain_from_appdomain (MonoAppDomain *appdomain)
 {
        if (appdomain == NULL)
                return NULL;
+
+       if (mono_object_is_transparent_proxy (&appdomain->mbr.obj)) {
+               MonoTransparentProxy *tp = (MonoTransparentProxy*)appdomain;
+               return mono_domain_get_by_id (tp->rp->target_domain_id);
+       }
        
        return appdomain->data;
 }
@@ -2418,7 +2423,7 @@ unload_thread_main (void *arg)
                goto failure;
        }
 
-       if (!mono_threadpool_ms_remove_domain_jobs (domain, -1)) {
+       if (!mono_threadpool_remove_domain_jobs (domain, -1)) {
                data->failure_reason = g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", domain->friendly_name);
                goto failure;
        }