[all-commits] [llvm/llvm-project] 5ef517: [lldb-vscode] Synchronize calls to SendTerminatedE...

Ayush Sahay via All-commits all-commits at lists.llvm.org
Fri Jun 11 09:08:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ef5177145b48e6379fe3a6434d3ff593fe7202a
      https://github.com/llvm/llvm-project/commit/5ef5177145b48e6379fe3a6434d3ff593fe7202a
  Author: Ayush Sahay <asahay at qti.qualcomm.com>
  Date:   2021-06-11 (Fri, 11 Jun 2021)

  Changed paths:
    M lldb/tools/lldb-vscode/lldb-vscode.cpp

  Log Message:
  -----------
  [lldb-vscode] Synchronize calls to SendTerminatedEvent

If an inferior exits prior to the processing of a disconnect request,
then the threads executing EventThreadFunction and request_discontinue
respectively may call SendTerminatedEvent simultaneously, in turn,
testing and/or setting g_vsc.sent_terminated_event without any
synchronization. In case the thread executing EventThreadFunction sets
it before the thread executing request_discontinue has had a chance to
test it, the latter would move ahead to issue a response to the
disconnect request. Said response may be dispatched ahead of the
terminated event compelling the client to terminate the debug session
without consuming any console output that might've been generated by
the execution of terminateCommands.

Reviewed By: clayborg, wallace

Differential Revision: https://reviews.llvm.org/D103609




More information about the All-commits mailing list