Skip to content

Commit 58b9603

Browse files
committed
Mark PyCoroutine, PyCoroutineWrapper as ThreadSafe
1 parent 73d9bac commit 58b9603

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/src/obj/objcoroutine.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::objstr::PyStringRef;
44
use super::objtype::PyClassRef;
55
use crate::frame::FrameRef;
66
use crate::function::OptionalArg;
7-
use crate::pyobject::{PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue};
7+
use crate::pyobject::{PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe};
88
use crate::vm::VirtualMachine;
99

1010
pub type PyCoroutineRef = PyRef<PyCoroutine>;
@@ -15,6 +15,8 @@ pub struct PyCoroutine {
1515
inner: Coro,
1616
}
1717

18+
impl ThreadSafe for PyCoroutine {}
19+
1820
impl PyValue for PyCoroutine {
1921
fn class(vm: &VirtualMachine) -> PyClassRef {
2022
vm.ctx.types.coroutine_type.clone()
@@ -101,6 +103,8 @@ pub struct PyCoroutineWrapper {
101103
coro: PyCoroutineRef,
102104
}
103105

106+
impl ThreadSafe for PyCoroutineWrapper {}
107+
104108
impl PyValue for PyCoroutineWrapper {
105109
fn class(vm: &VirtualMachine) -> PyClassRef {
106110
vm.ctx.types.coroutine_wrapper_type.clone()

0 commit comments

Comments
 (0)