mirror of https://github.com/stjepang/smol
Update concurrent-queue
This commit is contained in:
parent
2253923ec8
commit
e6bd9229f7
|
@ -27,7 +27,7 @@ tokio02 = ["tokio"]
|
|||
[dependencies]
|
||||
async-task = "3.0.0"
|
||||
blocking = "0.4.4"
|
||||
concurrent-queue = "1.0.0"
|
||||
concurrent-queue = "1.1.1"
|
||||
fastrand = "1.1.0"
|
||||
futures-io = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std", "io"] }
|
||||
|
|
|
@ -217,12 +217,7 @@ impl Worker<'_> {
|
|||
if let Some(r) = self.slot.replace(Some(runnable)) {
|
||||
// If the slot had a task, push it into the queue.
|
||||
if let Err(err) = self.queue.push(r) {
|
||||
use concurrent_queue::*;
|
||||
match err {
|
||||
PushError::Full(v) | PushError::Closed(v) => {
|
||||
self.executor.injector.push(v).unwrap();
|
||||
}
|
||||
}
|
||||
self.executor.injector.push(err.into_inner()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,12 +226,7 @@ impl Worker<'_> {
|
|||
fn flush_slot(&self) {
|
||||
if let Some(r) = self.slot.take() {
|
||||
if let Err(err) = self.queue.push(r) {
|
||||
use concurrent_queue::*;
|
||||
match err {
|
||||
PushError::Full(v) | PushError::Closed(v) => {
|
||||
self.executor.injector.push(v).unwrap();
|
||||
}
|
||||
}
|
||||
self.executor.injector.push(err.into_inner()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue