-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixed _CFThreadSetName line for Android #1309
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
Conversation
Does Android only allow the current thread's native name to be changed? |
If might be better to modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @spevans suggested, can you move this down into the _CFThreadSetName
code instead?
The error happens in this line if let thread = _thread { But this function is a c function! *CF_SWIFT_EXPORT int _CFThreadSetName(pthread_t thread, const char _Nonnull name) { |
Leave the Swift code as is, do the fix in the c function instead was @spevans suggestion, I believe. |
any suggestion of how to fix the c code? |
@amraboelela I mis-read your original patch and thought the thread name could only be set for the current thread hence my suggestion of fixing However on re-reading it I think the issue might be because on android the
I wonder if the special case for Android could be removed so it just uses the |
But there must be a reason why they did this code:
|
I don't think its correct. It used to be like that for Linux as well however |
Ok let me check it later |
@spevans I made the update and was able to build it successfully for Android |
@swift-ci please test |
Can we squash these two commits please? |
2e671a0
to
a2f0625
Compare
Done |
@swift-ci please test and merge |
No description provided.