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

Rework PCI emulation to better expose inner data #57

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion propolis/src/block/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl Driver {
})
}
fn blocking_loop(&self, sctx: &mut SyncCtx) {
let mut idled = false;
loop {
if sctx.check_yield() {
break;
Expand All @@ -113,14 +114,18 @@ impl Driver {
let mut guard = self.queue.lock().unwrap();
if let Some(req) = guard.pop_front() {
drop(guard);
idled = false;
let ctx = sctx.dispctx();
match process_request(&self.fp, &req, &ctx) {
Ok(_) => req.complete(block::Result::Success, &ctx),
Err(_) => req.complete(block::Result::Failure, &ctx),
}
} else {
// wait until more requests are available
self.idle_threads.add_permits(1);
if !idled {
self.idle_threads.add_permits(1);
idled = true;
}
let _guard = self
.cv
.wait_while(guard, |g| {
Expand Down
Loading