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 MutexGuard::map, as it is not safe in combination with Condvar. #31428

Merged
merged 1 commit into from
Feb 6, 2016

Conversation

reem
Copy link
Contributor

@reem reem commented Feb 5, 2016

It could return in the future if it returned a different guard type, which
could not be used with Condvar, otherwise it is unsafe as another thread
can invalidate an "inner" reference during a Condvar::wait.

cc #27746

It could return in the future if it returned a different guard type, which
could not be used with Condvar, otherwise it is unsafe as another thread
can invalidate an "inner" reference during a Condvar::wait.

cc rust-lang#27746
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@reem
Copy link
Contributor Author

reem commented Feb 5, 2016

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned aturon Feb 5, 2016
@huonw
Copy link
Member

huonw commented Feb 5, 2016

Whoops, nice catch! cc @rust-lang/libs

@sfackler
Copy link
Member

sfackler commented Feb 5, 2016

Bummer. I wonder if we can leave a comment in somewhere noting that this is intentionally missing so it doesn't get added back later by someone.

@alexcrichton
Copy link
Member

As this was only merge two days ago, I'm gonna go ahead an r+ this. We should probably continue discussion on the cell_extras stabilization issue, but nice catch @reem!

@bors: r+ a61983f

@bors
Copy link
Contributor

bors commented Feb 6, 2016

⌛ Testing commit a61983f with merge 915fa2a...

bors added a commit that referenced this pull request Feb 6, 2016
It could return in the future if it returned a different guard type, which
could not be used with Condvar, otherwise it is unsafe as another thread
can invalidate an "inner" reference during a Condvar::wait.

cc #27746
@bors bors merged commit a61983f into rust-lang:master Feb 6, 2016
@huonw
Copy link
Member

huonw commented Feb 6, 2016

Hm, shouldn't this have been #[deprecated] before removal?

@sfackler
Copy link
Member

sfackler commented Feb 7, 2016

The feature only existed for like 2 days and had serious soundness issues.
A deprecation period seems like a bit much personally.
On Sat, Feb 6, 2016 at 2:55 PM Huon Wilson notifications@github.com wrote:

Hm, shouldn't this have been #[deprecated] before removal?


Reply to this email directly or view it on GitHub
#31428 (comment).

@huonw
Copy link
Member

huonw commented Feb 7, 2016

Oh, sorry, yeah. For some reason, I had in my mind that Mutex had these before, and it was RwLock that got these new APIs (despite me suggesting that the original PR be expanded to include this...).

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.

7 participants