From d78df4d8be7f82a49e3f236e2ee32dcbb4a88c46 Mon Sep 17 00:00:00 2001 From: nosami Date: Wed, 20 Jul 2022 18:13:51 +0100 Subject: Set options before Dispatch This is a feedback fix in response to https://github.com/mono/debugger-libs/pull/371#discussion_r925712902 --- Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs b/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs index 9b38e5a..0a8ee83 100644 --- a/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs +++ b/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs @@ -410,9 +410,10 @@ namespace Mono.Debugging.Client if (options == null) throw new ArgumentNullException (nameof (options)); + Interlocked.Exchange (ref this.options, options); + Dispatch (delegate { try { - this.options = options; OnRunning (); OnRun (startInfo); } catch (Exception ex) { @@ -444,9 +445,10 @@ namespace Mono.Debugging.Client if (options == null) throw new ArgumentNullException (nameof (options)); + Interlocked.Exchange (ref this.options, options); + Dispatch (delegate { try { - this.options = options; OnRunning (); OnAttachToProcess (proc); attached = true; -- cgit v1.2.3