Skip to content

Correct a typo for thread-specific set [NFC] #1209

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

Merged
merged 3 commits into from
Sep 12, 2017
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 CoreFoundation/Base.subproj/CFPlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ CFTypeRef _Nullable _CFThreadSpecificGet(_CFThreadSpecificKey key) {
return (CFTypeRef)pthread_getspecific(key);
}

void _CThreadSpecificSet(_CFThreadSpecificKey key, CFTypeRef _Nullable value) {
void _CFThreadSpecificSet(_CFThreadSpecificKey key, CFTypeRef _Nullable value) {
if (value != NULL) {
swift_retain((void *)value);
pthread_setspecific(key, value);
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ CF_EXPORT CFHashCode __CFHashDouble(double d);

typedef pthread_key_t _CFThreadSpecificKey;
CF_EXPORT CFTypeRef _Nullable _CFThreadSpecificGet(_CFThreadSpecificKey key);
CF_EXPORT void _CThreadSpecificSet(_CFThreadSpecificKey key, CFTypeRef _Nullable value);
CF_EXPORT void _CFThreadSpecificSet(_CFThreadSpecificKey key, CFTypeRef _Nullable value);
CF_EXPORT _CFThreadSpecificKey _CFThreadSpecificKeyCreate(void);

typedef pthread_attr_t _CFThreadAttributes;
Expand Down
4 changes: 2 additions & 2 deletions Foundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ internal class NSThreadSpecific<T: NSObject> {
return specific as! T
} else {
let value = generator()
_CThreadSpecificSet(key, value)
_CFThreadSpecificSet(key, value)
return value
}
}

internal func set(_ value: T) {
_CThreadSpecificSet(key, value)
_CFThreadSpecificSet(key, value)
}
}

Expand Down