Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change threadDictionary to NSMutableDictionary #1762

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Foundation/Progress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public struct ProgressUserInfoKey : RawRepresentable, Equatable, Hashable {
public static let fileCompletedCountKey = ProgressUserInfoKey(rawValue: "NSProgressFileCompletedCountKey")
}

fileprivate class _ProgressTSD {
fileprivate class _ProgressTSD : NSObject {
/// The thread's default progress.
fileprivate var currentProgress : Progress

Expand Down
4 changes: 2 additions & 2 deletions Foundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ open class Thread : NSObject {
#endif
internal var _status = _NSThreadStatus.initialized
internal var _cancelled = false
/// - Note: this differs from the Darwin implementation in that the keys must be Strings
open var threadDictionary = [String : Any]()

open private(set) var threadDictionary: NSMutableDictionary = NSMutableDictionary()

internal init(thread: pthread_t) {
// Note: even on Darwin this is a non-optional pthread_t; this is only used for valid threads, which are never null pointers.
Expand Down
2 changes: 1 addition & 1 deletion Foundation/XMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ open class XMLParser : NSObject {
if let p = parser {
Thread.current.threadDictionary["__CurrentNSXMLParser"] = p
} else {
Thread.current.threadDictionary.removeValue(forKey: "__CurrentNSXMLParser")
Thread.current.threadDictionary.removeObject(forKey: "__CurrentNSXMLParser")
}
}

Expand Down