-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
rt(alt): fix a number of concurrency bugs #5907
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d8e6f4d
rt(alt): fix a number of concurrency bugs
carllerche f57374a
fmt
carllerche cdc82e2
revert not loom on_thread_start
carllerche 21359a2
fix warnings
carllerche e3f40aa
fix build
carllerche 9e6ac41
try again
carllerche d02b59b
and another ci fix
carllerche 990fa89
rm debug panic
carllerche 4038836
Merge remote-tracking branch 'origin/master' into fix-rt-alt-bug
carllerche e28e458
use released loom
carllerche d2d9f97
remove some debugging output
carllerche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
|
||
// Eventually, this file will see significant refactoring / cleanup. For now, we | ||
// don't need to worry much about dead code with certain feature permutations. | ||
#![cfg_attr(not(feature = "full"), allow(dead_code))] | ||
#![cfg_attr( | ||
any(not(all(tokio_unstable, feature = "full")), target_family = "wasm"), | ||
allow(dead_code) | ||
)] | ||
|
||
use crate::runtime::park::{ParkThread, UnparkThread}; | ||
|
||
|
@@ -58,6 +61,10 @@ impl Driver { | |
)) | ||
} | ||
|
||
pub(crate) fn is_enabled(&self) -> bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is added so the scheduler can avoid the extra thread if there are no resources to drive. |
||
self.inner.is_enabled() | ||
} | ||
|
||
pub(crate) fn park(&mut self, handle: &Handle) { | ||
self.inner.park(handle) | ||
} | ||
|
@@ -154,6 +161,13 @@ cfg_io_driver! { | |
} | ||
|
||
impl IoStack { | ||
pub(crate) fn is_enabled(&self) -> bool { | ||
match self { | ||
IoStack::Enabled(..) => true, | ||
IoStack::Disabled(..) => false, | ||
} | ||
} | ||
|
||
pub(crate) fn park(&mut self, handle: &Handle) { | ||
match self { | ||
IoStack::Enabled(v) => v.park(handle), | ||
|
@@ -217,6 +231,11 @@ cfg_not_io_driver! { | |
pub(crate) fn shutdown(&mut self, _handle: &Handle) { | ||
self.0.shutdown(); | ||
} | ||
|
||
/// This is not a "real" driver, so it is not considered enabled. | ||
pub(crate) fn is_enabled(&self) -> bool { | ||
false | ||
} | ||
} | ||
} | ||
|
||
|
@@ -298,6 +317,13 @@ cfg_time! { | |
} | ||
|
||
impl TimeDriver { | ||
pub(crate) fn is_enabled(&self) -> bool { | ||
match self { | ||
TimeDriver::Enabled { .. } => true, | ||
TimeDriver::Disabled(inner) => inner.is_enabled(), | ||
} | ||
} | ||
|
||
pub(crate) fn park(&mut self, handle: &Handle) { | ||
match self { | ||
TimeDriver::Enabled { driver, .. } => driver.park(handle), | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR makes the local queue capacity configurable but does not expose the option. At some point, it might, but right now, it is for tests.