Merge pull request #334 from puremourning/fix-node-thread

Fix node thread
This commit is contained in:
mergify[bot] 2021-01-08 11:49:20 +00:00 committed by GitHub
commit b180b14ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -188,11 +188,12 @@ class StackTraceView( object ):
return
def consume_threads( message ):
requesting = False
if self._requesting_threads == StackTraceView.ThreadRequestState.PENDING:
# We may have hit a thread event, so try again.
self._requesting_threads = StackTraceView.ThreadRequestState.NO
self.LoadThreads( *self._pending_thread_request )
return
requesting = True
self._requesting_threads = StackTraceView.ThreadRequestState.NO
self._pending_thread_request = None
@ -211,8 +212,6 @@ class StackTraceView( object ):
stoppedThreadId = stopEvent.get( 'threadId' )
allThreadsStopped = stopEvent.get( 'allThreadsStopped', False )
requesting = False
# FIXME: This is horribly inefficient
for t in message[ 'body' ][ 'threads' ]:
thread = None
@ -240,7 +239,10 @@ class StackTraceView( object ):
# If this is a stopped event, load the stack trace for the "current"
# thread. Don't do this on other thrads requests because some servers
# just break when that happens.
if infer_current_frame:
#
# Don't do this if we're also satisfying a cached request already (we'll
# do it then)
if infer_current_frame and not requesting:
if thread.id == self._current_thread:
if thread.CanExpand():
self._LoadStackTrace( thread, True, reason )

View file

@ -3,6 +3,8 @@
set SCALAR g
array set ARRAY {key1 value1 key2 value2}
set LIST [list a b c {def} {g h i j} k l m]
proc Wrap { body } {
uplevel 1 $body
}