Skip to content

fix: Use tokio as pl011 thread#98

Merged
junyu0312 merged 1 commit intomainfrom
refine
Mar 11, 2026
Merged

fix: Use tokio as pl011 thread#98
junyu0312 merged 1 commit intomainfrom
refine

Conversation

@junyu0312
Copy link
Owner

@junyu0312 junyu0312 commented Mar 11, 2026

Summary by CodeRabbit

  • Refactor
    • Device standard input handling updated to use async task-based execution instead of thread-based execution. Core functionality remains unchanged.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25444abe-eb00-4c71-92bd-d4648a16448f

📥 Commits

Reviewing files that changed from the base of the PR and between aeb0da4 and 4071fd9.

📒 Files selected for processing (1)
  • crates/vm-device/src/device/pl011.rs

📝 Walkthrough

Walkthrough

The change converts the Pl011 device's concurrency mechanism from standard OS threads to Tokio async tasks by replacing thread::spawn with tokio::spawn and converting the closure to an async move block, while maintaining the same stdin-reading logic.

Changes

Cohort / File(s) Summary
Async Runtime Conversion
crates/vm-device/src/device/pl011.rs
Replaced std::thread::spawn with tokio::spawn and converted spawned closure to async move block. Inner stdin-reading and device-driving logic remains unchanged; only concurrency mechanism updated from OS threads to Tokio tasks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐰 A rabbit hops through async streams,
Trading threads for Tokio dreams,
The Pl011 device now plays,
In async loops through all its days!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refine

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@junyu0312 junyu0312 merged commit 9392015 into main Mar 11, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant