提交 50c4e59a 编写于 作者: L Lukasz Paczkowski

[debugger-agent] Store unload_domain in DebuggerTlsData in case multiple...

[debugger-agent] Store unload_domain in DebuggerTlsData in case multiple domains are being unloaded concurrently.
上级 732d6530
......@@ -237,6 +237,9 @@ typedef struct {
* The current mono_runtime_invoke invocation.
*/
InvokeData *invoke;
/* Current Mono domain being unloaded, if any */
MonoDomain* unload_domain;
} DebuggerTlsData;
/*
......@@ -590,8 +593,6 @@ static gboolean protocol_version_set;
/* A hash table containing all active domains */
static GHashTable *domains;
static MonoDomain* unload_domain = NULL;
static void transport_connect (const char *host, int port);
static guint32 WINAPI debugger_thread (void *arg);
......@@ -2934,11 +2935,15 @@ event_to_string (EventKind event)
static MonoDomain* get_assembly_unload_domain(MonoAssembly *assembly)
{
if(!unload_domain)
DebuggerTlsData *tls;
tls = TlsGetValue (debugger_tls_id);
if(!tls->unload_domain)
return NULL;
if(g_slist_find(unload_domain->domain_assemblies, assembly))
return unload_domain;
if(g_slist_find(tls->unload_domain->domain_assemblies, assembly))
return tls->unload_domain;
return NULL;
}
......@@ -3266,22 +3271,25 @@ appdomain_load (MonoProfiler *prof, MonoDomain *domain, int result)
static void
appdomain_unload_start (MonoProfiler *prof, MonoDomain *domain)
{
mono_loader_lock ();
unload_domain = domain;
mono_loader_unlock ();
DebuggerTlsData *tls;
tls = TlsGetValue (debugger_tls_id);
tls->unload_domain = domain;
}
static void
appdomain_unload_end (MonoProfiler *prof, MonoDomain *domain)
{
DebuggerTlsData *tls;
tls = TlsGetValue (debugger_tls_id);
tls->unload_domain = NULL;
process_profiler_event (EVENT_KIND_APPDOMAIN_UNLOAD, domain);
clear_breakpoints_for_domain (domain);
mono_loader_lock ();
unload_domain = NULL;
/* Invalidate each thread's frame stack */
mono_g_hash_table_foreach (thread_to_tls, invalidate_each_thread, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册