Skip to content

Commit 1f06596

Browse files
authored
Merge pull request #1762 from omochi/tls-nsmutabledictionary
Change threadDictionary to NSMutableDictionary
2 parents 248fc2e + aba7feb commit 1f06596

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Foundation/Progress.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ public struct ProgressUserInfoKey : RawRepresentable, Equatable, Hashable {
537537
public static let fileCompletedCountKey = ProgressUserInfoKey(rawValue: "NSProgressFileCompletedCountKey")
538538
}
539539

540-
fileprivate class _ProgressTSD {
540+
fileprivate class _ProgressTSD : NSObject {
541541
/// The thread's default progress.
542542
fileprivate var currentProgress : Progress
543543

Foundation/Thread.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ open class Thread : NSObject {
153153
#endif
154154
internal var _status = _NSThreadStatus.initialized
155155
internal var _cancelled = false
156-
/// - Note: this differs from the Darwin implementation in that the keys must be Strings
157-
open var threadDictionary = [String : Any]()
156+
157+
open private(set) var threadDictionary: NSMutableDictionary = NSMutableDictionary()
158158

159159
internal init(thread: pthread_t) {
160160
// Note: even on Darwin this is a non-optional pthread_t; this is only used for valid threads, which are never null pointers.

Foundation/XMLParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ open class XMLParser : NSObject {
471471
if let p = parser {
472472
Thread.current.threadDictionary["__CurrentNSXMLParser"] = p
473473
} else {
474-
Thread.current.threadDictionary.removeValue(forKey: "__CurrentNSXMLParser")
474+
Thread.current.threadDictionary.removeObject(forKey: "__CurrentNSXMLParser")
475475
}
476476
}
477477

0 commit comments

Comments
 (0)