Skip to content

Commit 676c641

Browse files
committed
Mark PySymbol, PySymbolTable as ThreadSafe
1 parent 13f2377 commit 676c641

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/src/stdlib/symtable.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustpython_parser::parser;
55

66
use crate::obj::objstr::PyStringRef;
77
use crate::obj::objtype::PyClassRef;
8-
use crate::pyobject::{PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue};
8+
use crate::pyobject::{PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe};
99
use crate::vm::VirtualMachine;
1010

1111
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
@@ -72,6 +72,8 @@ struct PySymbolTable {
7272
symtable: symboltable::SymbolTable,
7373
}
7474

75+
impl ThreadSafe for PySymbolTable {}
76+
7577
impl fmt::Debug for PySymbolTable {
7678
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7779
write!(f, "SymbolTable()")
@@ -158,6 +160,8 @@ struct PySymbol {
158160
symbol: symboltable::Symbol,
159161
}
160162

163+
impl ThreadSafe for PySymbol {}
164+
161165
impl fmt::Debug for PySymbol {
162166
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163167
write!(f, "Symbol()")

0 commit comments

Comments
 (0)