mono/debugger-libs — pull request #21 by DavidKarlas (2014-04-23 10:33:33+00:00)
Title: Ensure execution order of calls

Before this change it could happen that calling 2 commands one after another to be executed in different order that it was called. This happens because ThreadPool.QueueUserWorkItem does not guarantee order of execution(even though Queue in name :))

I noticed this problem at RunToCursor where AddBreakpoint call was invoked after Continue call.

Btw can someone explain reason for lock (slock) inside Dispatch() ThreadPool.QueueUserWorkItem if UseOperationThread is true because it seems to me whole purpose of UseOperationThread is lost because methods like Run, AttachToProcess, Detach, NextLine, StepLine, NextInstruction, StepInstruction... Which call Dispatch so actions are executed on background thread are blocked by lock(slock) and whole purpose of UseOperationThread is lost.

I kept that lock(slock) for now...