@@ -2096,7 +2096,7 @@ product_traverse(PyObject *op, visitproc visit, void *arg)
20962096}
20972097
20982098static PyObject *
2099- product_next (PyObject * op )
2099+ product_next_lock_held (PyObject * op )
21002100{
21012101 productobject * lz = productobject_CAST (op );
21022102 PyObject * pool ;
@@ -2182,6 +2182,16 @@ product_next(PyObject *op)
21822182 return NULL ;
21832183}
21842184
2185+ static PyObject *
2186+ product_next (PyObject * op )
2187+ {
2188+ PyObject * result ;
2189+ Py_BEGIN_CRITICAL_SECTION (op );
2190+ result = product_next_lock_held (op );
2191+ Py_END_CRITICAL_SECTION ()
2192+ return result ;
2193+ }
2194+
21852195static PyMethodDef product_methods [] = {
21862196 {"__sizeof__" , product_sizeof , METH_NOARGS , sizeof_doc },
21872197 {NULL , NULL } /* sentinel */
@@ -2329,7 +2339,7 @@ combinations_traverse(PyObject *op, visitproc visit, void *arg)
23292339}
23302340
23312341static PyObject *
2332- combinations_next (PyObject * op )
2342+ combinations_next_lock_held (PyObject * op )
23332343{
23342344 combinationsobject * co = combinationsobject_CAST (op );
23352345 PyObject * elem ;
@@ -2414,6 +2424,16 @@ combinations_next(PyObject *op)
24142424 return NULL ;
24152425}
24162426
2427+ static PyObject *
2428+ combinations_next (PyObject * op )
2429+ {
2430+ PyObject * result ;
2431+ Py_BEGIN_CRITICAL_SECTION (op );
2432+ result = combinations_next_lock_held (op );
2433+ Py_END_CRITICAL_SECTION ()
2434+ return result ;
2435+ }
2436+
24172437static PyMethodDef combinations_methods [] = {
24182438 {"__sizeof__" , combinations_sizeof , METH_NOARGS , sizeof_doc },
24192439 {NULL , NULL } /* sentinel */
0 commit comments