Skip to content

Commit 33a6e77

Browse files
committed
tmp
1 parent 235adaf commit 33a6e77

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

stdlib/src/faulthandler.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@ pub(crate) use decl::make_module;
22

33
#[pymodule(name = "faulthandler")]
44
mod decl {
5+
use std::sync::atomic::AtomicBool;
6+
use rustpython_common::lock::{PyMutex, PyRwLock};
57
use crate::vm::{frame::Frame, function::OptionalArg, stdlib::sys::PyStderr, VirtualMachine};
68

9+
struct FaultHandlerThread {
10+
enabled: AtomicBool,
11+
name: PyMutex<String>
12+
}
13+
14+
static FAULT_HANDLER_THREADS: PyRwLock<Vec<FaultHandlerThread>> = PyRwLock::new(Vec::new());
15+
716
fn dump_frame(frame: &Frame, vm: &VirtualMachine) {
817
let stderr = PyStderr(vm);
918
writeln!(
@@ -29,6 +38,20 @@ mod decl {
2938
}
3039
}
3140

41+
#[pyfunction]
42+
fn dump_traceback_later(
43+
timeout: f32,
44+
repeat: OptionalArg<bool>,
45+
_file: OptionalArg<i32>,
46+
exit: OptionalArg<bool>,
47+
vm: &VirtualMachine,
48+
) {
49+
let timeout_micros = std::time::Duration::from_secs_f32(timeout);
50+
let repeat = repeat.unwrap_or(false);
51+
let exit = exit.unwrap_or(false);
52+
53+
}
54+
3255
#[derive(FromArgs)]
3356
#[allow(unused)]
3457
struct EnableArgs {

0 commit comments

Comments
 (0)