Skip to content

Commit

Permalink
fix(runtime): move FutureState to mod time
Browse files Browse the repository at this point in the history
  • Loading branch information
Berrysoft committed May 13, 2024
1 parent fb50654 commit 1934885
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 1 addition & 12 deletions compio-runtime/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
panic::AssertUnwindSafe,
rc::{Rc, Weak},
sync::Arc,
task::{Context, Poll, Waker},
task::{Context, Poll},
time::Duration,
};

Expand All @@ -30,17 +30,6 @@ use crate::{runtime::op::OpFuture, BufResult};

pub type JoinHandle<T> = Task<Result<T, Box<dyn Any + Send>>>;

pub(crate) enum FutureState {
Active(Option<Waker>),
Completed,
}

impl Default for FutureState {
fn default() -> Self {
Self::Active(None)
}
}

pub(crate) struct RuntimeInner {
driver: RefCell<Proactor>,
runnables: Arc<SegQueue<Runnable>>,
Expand Down
13 changes: 12 additions & 1 deletion compio-runtime/src/runtime/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ use std::{

use slab::Slab;

use crate::runtime::{FutureState, Runtime};
use crate::runtime::Runtime;

pub(crate) enum FutureState {
Active(Option<Waker>),
Completed,
}

impl Default for FutureState {
fn default() -> Self {
Self::Active(None)
}
}

#[derive(Debug)]
struct TimerEntry {
Expand Down

0 comments on commit 1934885

Please sign in to comment.