@@ -36,9 +36,9 @@ fileprivate func legacySendDataStub(_: NSData) -> Void {
3636
3737@_silgen_name ( " playground_log_hidden " )
3838public func legacyLog< T> ( instance: T , name: String , id: Int , startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
39- guard !PGLThreadIsLogging else { return nil }
40- PGLThreadIsLogging = true
41- defer { PGLThreadIsLogging = false }
39+ guard !PGLGetThreadIsLogging ( ) else { return nil }
40+ PGLSetThreadIsLogging ( true )
41+ defer { PGLSetThreadIsLogging ( false ) }
4242
4343 let packet = LogPacket ( describingResult: instance, named: name, withPolicy: . default, startLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
4444
@@ -73,9 +73,9 @@ public func legacyLog<T>(instance: T, name: String, id: Int, startLine: Int, end
7373
7474@_silgen_name ( " playground_log_scope_entry " )
7575public func legacyLogScopeEntry( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
76- guard !PGLThreadIsLogging else { return nil }
77- PGLThreadIsLogging = true
78- defer { PGLThreadIsLogging = false }
76+ guard !PGLGetThreadIsLogging ( ) else { return nil }
77+ PGLSetThreadIsLogging ( true )
78+ defer { PGLSetThreadIsLogging ( false ) }
7979
8080 let packet = LogPacket ( scopeEntryWithStartLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
8181
@@ -87,9 +87,9 @@ public func legacyLogScopeEntry(startLine: Int, endLine: Int, startColumn: Int,
8787
8888@_silgen_name ( " playground_log_scope_exit " )
8989public func legacyLogScopeExit( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
90- guard !PGLThreadIsLogging else { return nil }
91- PGLThreadIsLogging = true
92- defer { PGLThreadIsLogging = false }
90+ guard !PGLGetThreadIsLogging ( ) else { return nil }
91+ PGLSetThreadIsLogging ( true )
92+ defer { PGLSetThreadIsLogging ( false ) }
9393
9494 let packet = LogPacket ( scopeExitWithStartLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
9595
@@ -101,9 +101,9 @@ public func legacyLogScopeExit(startLine: Int, endLine: Int, startColumn: Int, e
101101
102102@_silgen_name ( " playground_log_postprint " )
103103public func legacyLogPostPrint( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
104- guard !PGLThreadIsLogging else { return nil }
105- PGLThreadIsLogging = true
106- defer { PGLThreadIsLogging = false }
104+ guard !PGLGetThreadIsLogging ( ) else { return nil }
105+ PGLSetThreadIsLogging ( true )
106+ defer { PGLSetThreadIsLogging ( false ) }
107107
108108 let printedString = Thread . current. threadDictionary [ printedStringThreadDictionaryKey] as! String ? ?? " "
109109
0 commit comments