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

crypto: replace rwlocks with simple mutexes (v0.12) #2803

Merged
merged 1 commit into from
Sep 11, 2015

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Sep 11, 2015

Cherry-pick of #2723 for v0.12

/R=@bnoordhuis, @indutny

It was pointed out by Zhou Ran that the Windows XP implementation of
uv_rwlock_rdlock() and friends may unlock the inner write mutex on a
different thread than the one that locked it, resulting in undefined
behavior.

The only place that uses rwlocks is the crypto module.  Make that use
normal (simple) mutexes instead.

OpenSSL's critical sections are generally very short, with exclusive
access outnumbering shared access by a factor of three or more, so
it's not as if using rwlocks gives a decisive performance advantage.

PR-URL: nodejs#2723
Reviewed-By: Fedor Indutny <fedor@indutny.com>
@rvagg rvagg changed the title crypto: replace rwlocks with simple mutexes crypto: replace rwlocks with simple mutexes (v0.12) Sep 11, 2015
@indutny
Copy link
Member

indutny commented Sep 11, 2015

LGTM

@rvagg
Copy link
Member Author

rvagg commented Sep 11, 2015

@rvagg rvagg merged commit 071c860 into nodejs:v0.12 Sep 11, 2015
@ChALkeR ChALkeR added crypto Issues and PRs related to the crypto subsystem. land-on-v0.12 labels Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants