[WIP]: Threading (macOS): implement set_name #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A name cannot be set directly on another thread, it can only be set on itself, but it can be staged as a self instruct and send it off with a signal handler to another thread. This can be used for reporting back on the status of the request. This is needed in order to achieve unity where the function throws an error if it fails; we need feedback to know if it failed.
Sadly not as direct or controlled as on windows/linux, but it's possible. Removing the check can result in a bad read during a race condition.
The tester for instance is one such case as it doesn't give the scheduler enough time to process the request but instead immediately requesting a get_name and failing - give it 1 microsecond or allow the flag to report back and it passes, so it's not that mac doesn't want to set the name, it just wants to do it on it's own accord...