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 os_unfair_lock calls to use a dispatch queue instead. #837

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

kstenerud
Copy link
Contributor

Goal

#832 shows a crash in os_unfair_lock_unlock that couldn't be traced back to anything user-side. Since we can't repro the issue, we need another way to defend against this.

Design

os_unfair_lock is a relatively new API, so it's not inconceivable that there could still be bugs in it. Dispatch queues, on the other hand, have been battle-hardened over decades. Dispatching to a local queue on a local thread has very low overhead, and will introduce far less latency than calling NSProcessInfo, so this will on the whole run faster.

Changeset

bsg_mach_headers_add_image now uses a dispatch queue rather than os_unfair_lock or OSSpinLock.

Testing

Re-ran all unit tests, and did manual tests to ensure end-to-end symbolication.

@kstenerud kstenerud changed the base branch from master to next October 9, 2020 08:24
Copy link
Contributor

@nickdowell nickdowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@kstenerud kstenerud merged commit e8c23f6 into next Oct 12, 2020
@kstenerud kstenerud deleted the 5184-dispatch-queue branch October 12, 2020 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants