From 99be20736601f7de2a78ed2325b9b2efd32b6b73 Mon Sep 17 00:00:00 2001 From: Aviv Palivoda Date: Fri, 24 Apr 2020 14:39:43 +0300 Subject: [PATCH] Mark PyCallableIterator, PySequenceIterator as ThreadSafe --- vm/src/obj/objiter.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vm/src/obj/objiter.rs b/vm/src/obj/objiter.rs index 4d48de150..c162aca21 100644 --- a/vm/src/obj/objiter.rs +++ b/vm/src/obj/objiter.rs @@ -10,8 +10,8 @@ use super::objsequence; use super::objtype::{self, PyClassRef}; use crate::exceptions::PyBaseExceptionRef; use crate::pyobject::{ - PyCallable, PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, - TypeProtocol, + PyCallable, PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe, + TryFromObject, TypeProtocol, }; use crate::vm::VirtualMachine; @@ -141,6 +141,7 @@ pub struct PySequenceIterator { pub obj: PyObjectRef, pub reversed: bool, } +impl ThreadSafe for PySequenceIterator {} impl PyValue for PySequenceIterator { fn class(vm: &VirtualMachine) -> PyClassRef { @@ -214,6 +215,7 @@ pub struct PyCallableIterator { sentinel: PyObjectRef, done: AtomicCell, } +impl ThreadSafe for PyCallableIterator {} impl PyValue for PyCallableIterator { fn class(vm: &VirtualMachine) -> PyClassRef {