Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sources/TokenExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ private class TokenExecutorImpl {
// Runs block synchronously while token executor is stopped.
func whilePaused(_ block: () -> (), onExecutorQueue: Bool) {
dispatchPrecondition(condition: .onQueue(.main))
if iTermGCD.joined {
// Already joined (likely re-entrant via a nested runloop). Avoid deadlock by reusing
// the existing join instead of creating a new one.
block()
return
}
if gDebugLogging.boolValue { DLog("Incr pending pauses if \(iTermPreferences.maximizeThroughput())") }
var unpauser = iTermPreferences.maximizeThroughput() ? nil : TokenExecutor.globalPause()

Expand Down