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

Remove locking #9

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Remove locking #9

merged 1 commit into from
Apr 23, 2024

Conversation

ctz
Copy link
Member

@ctz ctz commented Apr 23, 2024

This was the wrong direction: coming commits want to call callbacks (which themselves can and do re-enter the API) which would lead to deadlock.

Let's just accept that the API we're implementing is not thread safe.

I also looked at deferring callbacks to outside the lock scope, but that removes the ability for callbacks to have side effects during the handshake.

@ctz ctz force-pushed the jbp-remove-locking branch from 69c188a to 0d4dec0 Compare April 23, 2024 10:03
Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

🎶 sad trombone sound 🎶

The justification for this change makes sense to me. I flagged a couple small style nits to take/leave as you want.

One question: I see that the Error::cannot_lock() fn and the Reason::UnableToGetWriteLock variant are left in, was that oversight or for future use?

rustls-libssl/src/entry.rs Outdated Show resolved Hide resolved
rustls-libssl/src/lib.rs Outdated Show resolved Hide resolved
@ctz
Copy link
Member Author

ctz commented Apr 23, 2024

One question: I see that the Error::cannot_lock() fn and the Reason::UnableToGetWriteLock variant are left in, was that oversight or for future use?

Will remove that. Thanks!

This was the wrong direction: coming commits want to call
callbacks (which themselves can and do re-enter the API)
which would lead to deadlock.

Let's just accept that the API we're implementing is
not thread safe.

I also looked at deferring callbacks to outside the lock scope,
but that removes the ability for callbacks to have side effects
during the handshake.
@ctz ctz force-pushed the jbp-remove-locking branch from 0d4dec0 to 88f97d7 Compare April 23, 2024 14:31
@ctz ctz merged commit 9200ad1 into main Apr 23, 2024
20 checks passed
@ctz ctz deleted the jbp-remove-locking branch April 23, 2024 14:41
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.

2 participants