@@ -175,6 +175,7 @@ genrand_uint32(RandomObject *self)
175175 */
176176
177177/*[clinic input]
178+ @critical_section
178179_random.Random.random
179180
180181 self: self(type="RandomObject *")
@@ -184,7 +185,7 @@ random() -> x in the interval [0, 1).
184185
185186static PyObject *
186187_random_Random_random_impl (RandomObject * self )
187- /*[clinic end generated code: output=117ff99ee53d755c input=afb2a59cbbb00349 ]*/
188+ /*[clinic end generated code: output=117ff99ee53d755c input=26492e52d26e8b7b ]*/
188189{
189190 uint32_t a = genrand_uint32 (self )>>5 , b = genrand_uint32 (self )>>6 ;
190191 return PyFloat_FromDouble ((a * 67108864.0 + b )* (1.0 /9007199254740992.0 ));
@@ -368,6 +369,7 @@ random_seed(RandomObject *self, PyObject *arg)
368369}
369370
370371/*[clinic input]
372+ @critical_section
371373_random.Random.seed
372374
373375 self: self(type="RandomObject *")
@@ -382,7 +384,7 @@ of the current time and the process identifier.
382384
383385static PyObject *
384386_random_Random_seed_impl (RandomObject * self , PyObject * n )
385- /*[clinic end generated code: output=0fad1e16ba883681 input=78d6ef0d52532a54 ]*/
387+ /*[clinic end generated code: output=0fad1e16ba883681 input=46d01d2ba938c7b1 ]*/
386388{
387389 if (random_seed (self , n ) < 0 ) {
388390 return NULL ;
@@ -391,6 +393,7 @@ _random_Random_seed_impl(RandomObject *self, PyObject *n)
391393}
392394
393395/*[clinic input]
396+ @critical_section
394397_random.Random.getstate
395398
396399 self: self(type="RandomObject *")
@@ -400,7 +403,7 @@ getstate() -> tuple containing the current state.
400403
401404static PyObject *
402405_random_Random_getstate_impl (RandomObject * self )
403- /*[clinic end generated code: output=bf6cef0c092c7180 input=b937a487928c0e89 ]*/
406+ /*[clinic end generated code: output=bf6cef0c092c7180 input=b6621f31eb639694 ]*/
404407{
405408 PyObject * state ;
406409 PyObject * element ;
@@ -428,6 +431,7 @@ _random_Random_getstate_impl(RandomObject *self)
428431
429432
430433/*[clinic input]
434+ @critical_section
431435_random.Random.setstate
432436
433437 self: self(type="RandomObject *")
@@ -438,8 +442,8 @@ setstate(state) -> None. Restores generator state.
438442[clinic start generated code]*/
439443
440444static PyObject *
441- _random_Random_setstate (RandomObject * self , PyObject * state )
442- /*[clinic end generated code: output=fd1c3cd0037b6681 input=b3b4efbb1bc66af8 ]*/
445+ _random_Random_setstate_impl (RandomObject * self , PyObject * state )
446+ /*[clinic end generated code: output=babfc2c2eac6b027 input=358e898ec07469b7 ]*/
443447{
444448 int i ;
445449 unsigned long element ;
@@ -479,7 +483,7 @@ _random_Random_setstate(RandomObject *self, PyObject *state)
479483}
480484
481485/*[clinic input]
482-
486+ @critical_section
483487_random.Random.getrandbits
484488
485489 self: self(type="RandomObject *")
@@ -491,7 +495,7 @@ getrandbits(k) -> x. Generates an int with k random bits.
491495
492496static PyObject *
493497_random_Random_getrandbits_impl (RandomObject * self , int k )
494- /*[clinic end generated code: output=b402f82a2158887f input=8c0e6396dd176fc0 ]*/
498+ /*[clinic end generated code: output=b402f82a2158887f input=87603cd60f79f730 ]*/
495499{
496500 int i , words ;
497501 uint32_t r ;
0 commit comments