diff --git a/src/runtime/trace.go b/src/runtime/trace.go index 7d47ae02a9..871871c279 100644 --- a/src/runtime/trace.go +++ b/src/runtime/trace.go @@ -956,7 +956,7 @@ func traceReader() *g { // scheduled and should be. Callers should first check that // (traceEnabled() || traceShuttingDown()) is true. func traceReaderAvailable() *g { - // There are three conditions under which we definitely want to schedule + // There are two conditions under which we definitely want to schedule // the reader: // - The reader is lagging behind in finishing off the last generation. // In this case, trace buffers could even be empty, but the trace @@ -965,12 +965,10 @@ func traceReaderAvailable() *g { // - The reader has pending work to process for it's reader generation // (assuming readerGen is not lagging behind). Note that we also want // to be careful *not* to schedule the reader if there's no work to do. - // - The trace is shutting down. The trace stopper blocks on the reader - // to finish, much like trace advancement. // // We also want to be careful not to schedule the reader if there's no // reason to. - if trace.flushedGen.Load() == trace.readerGen.Load() || trace.workAvailable.Load() || trace.shutdown.Load() { + if trace.flushedGen.Load() == trace.readerGen.Load() || trace.workAvailable.Load() { return trace.reader.Load() } return nil