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

RwLock guards are Sync if T is #45682

Merged
merged 1 commit into from
Nov 7, 2017
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Nov 1, 2017

Currently, the compiler requires T to also be Send. There is no reason for
that. &Rw{Read,Write}LockGuard only provides a shared referenced to T, sending
that across threads is safe if T is Sync.

Cc @oconnor663

Currently, the compiler requires `T` to also be `Send`.  There is no reason for
that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
that across threads is safe if `T` is `Sync`.
@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 1, 2017
@carols10cents
Copy link
Member

r? @estebank

@estebank
Copy link
Contributor

estebank commented Nov 6, 2017

The change seems reasonable to me. I'd r+. @rust-lang/compiler, any reason to deny?

@eddyb
Copy link
Member

eddyb commented Nov 6, 2017

cc @alexcrichton @aturon

@alexcrichton
Copy link
Member

@bors: r+

Thanks @RalfJung!

@bors
Copy link
Contributor

bors commented Nov 6, 2017

📌 Commit 71534c4 has been approved by alexcrichton

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Nov 7, 2017
RwLock guards are Sync if T is

Currently, the compiler requires `T` to also be `Send`.  There is no reason for
that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
that across threads is safe if `T` is `Sync`.

Cc @oconnor663
kennytm added a commit to kennytm/rust that referenced this pull request Nov 7, 2017
RwLock guards are Sync if T is

Currently, the compiler requires `T` to also be `Send`.  There is no reason for
that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
that across threads is safe if `T` is `Sync`.

Cc @oconnor663
bors added a commit that referenced this pull request Nov 7, 2017
Rollup of 9 pull requests

- Successful merges: #45470, #45588, #45682, #45714, #45751, #45764, #45778, #45782, #45784
- Failed merges:
@bors bors merged commit 71534c4 into rust-lang:master Nov 7, 2017
@RalfJung RalfJung deleted the rwlock-guards branch July 10, 2018 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants