pub async fn handle_exception(&self, type_: ExceptionType) {
        let exception = {
            let mut inner = self.inner.lock();
            let cx = if !type_.is_synth() {
                inner.context.as_ref().map(|cx| cx.as_ref())
            } else {
                None
            };
            if !type_.is_synth() {
                error!(
                    "User mode exception: {:?} {:#x?}",
                    type_,
                    cx.expect("Architectural exception should has context")
                );
            }
            let exception = Exception::new(&self.0, type_, cx);
            inner.exception = Some(exception.clone());
            exception
        };
        if type_ == ExceptionType::ThreadExiting {
            let handled = self
                .0
                .proc()
                .debug_exceptionate()
                .send_exception(&exception);
            if let Ok(future) = handled {
                self.dying_run(future).await.ok();
            }
        } else {
            let future = exception.handle();
            pin_mut!(future);
            self.blocking_run(
                future,
                ThreadState::BlockedException,
                Duration::from_nanos(u64::max_value()),
                None,
            )
            .await
            .ok();
        }
        self.inner.lock().exception = None;
    }
/// Create an exception on this thread and wait for the handling.
Create an exception on this thread and wait for the handling.
Create an exception on this thread and wait for the handling .
pub async fn handle_exception(&self, type_: ExceptionType) {
        let exception = {
            let mut inner = self.inner.lock();
            let cx = if !type_.is_synth() {
                inner.context.as_ref().map(|cx| cx.as_ref())
            } else {
                None
            };
            if !type_.is_synth() {
                error!(
                    "User mode exception: {:?} {:#x?}",
                    type_,
                    cx.expect("Architectural exception should has context")
                );
            }
            let exception = Exception::new(&self.0, type_, cx);
            inner.exception = Some(exception.clone());
            exception
        };
        if type_ == ExceptionType::ThreadExiting {
            let handled = self
                .0
                .proc()
                .debug_exceptionate()
                .send_exception(&exception);
            if let Ok(future) = handled {
                self.dying_run(future).await.ok();
            }
        } else {
            let future = exception.handle();
            pin_mut!(future);
            self.blocking_run(
                future,
                ThreadState::BlockedException,
                Duration::from_nanos(u64::max_value()),
                None,
            )
            .await
            .ok();
        }
        self.inner.lock().exception = None;
    }
pub async fn handle_exception ( & self , type_ : ExceptionType ) { let exception = { let mut inner = self . inner . lock ( ) ; let cx = if ! type_ . is_synth ( ) { inner . context . as_ref ( ) . map ( | cx | cx . as_ref ( ) ) } else { None } ; if ! type_ . is_synth ( ) { error ! ( " " type_ cx expect ( " " ) ) ; } let exception = Exception :: new ( & self . 0 , type_ , cx ) ; inner . exception = Some ( exception . clone ( ) ) ; exception } ; if type_ == ExceptionType :: ThreadExiting { let handled = self . 0 . proc ( ) . debug_exceptionate ( ) . send_exception ( & exception ) ; if let Ok ( future ) = handled { self . dying_run ( future ) . await . ok ( ) ; } } else { let future = exception . handle ( ) ; pin_mut ! ( future ) ; self . blocking_run ( future , ThreadState :: BlockedException , Duration :: from_nanos ( u64 :: max_value ( ) ) , None , ) . await . ok ( ) ; } self . inner . lock ( ) . exception = None ; }
Create an exception on this thread and wait for the handling.
Create an exception on this thread and wait for the handling .
&self
type_
ExceptionType
&self
type_
ExceptionType