Skip to content

Commit ceb7ca6

Browse files
committed
Mark PyCode as ThreadSafe
1 parent 804d9c5 commit ceb7ca6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

vm/src/obj/objcode.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use std::ops::Deref;
77

88
use super::objtype::PyClassRef;
99
use crate::bytecode;
10-
use crate::pyobject::{IdProtocol, PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue};
10+
use crate::pyobject::{
11+
IdProtocol, PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe,
12+
};
1113
use crate::vm::VirtualMachine;
1214

1315
pub type PyCodeRef = PyRef<PyCode>;
@@ -17,6 +19,8 @@ pub struct PyCode {
1719
pub code: bytecode::CodeObject,
1820
}
1921

22+
impl ThreadSafe for PyCode {}
23+
2024
impl Deref for PyCode {
2125
type Target = bytecode::CodeObject;
2226
fn deref(&self) -> &Self::Target {

0 commit comments

Comments
 (0)