-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes `Send` from `EnterGuard` (returned by `Handle::enter()`. The guard type changes a thread-local variable on drop. If the guard is moved to a different thread, it would modify the wrong thread-local. This is a **breaking change** but it fixes a bug and prevents incorrect user behavior. If user code breaks because of this, it is because they (most likely) have a bug in their code.
- Loading branch information
1 parent
1571201
commit e75ca93
Showing
4 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// Marker for types that are `Sync` but not `Send` | ||
pub(crate) struct SyncNotSend(*mut ()); | ||
|
||
unsafe impl Sync for SyncNotSend {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,3 +79,5 @@ pub(crate) mod error; | |
|
||
#[cfg(feature = "io-util")] | ||
pub(crate) mod memchr; | ||
|
||
pub(crate) mod markers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters