@@ -175,6 +175,7 @@ genrand_uint32(RandomObject *self)
175
175
*/
176
176
177
177
/*[clinic input]
178
+ @critical_section
178
179
_random.Random.random
179
180
180
181
self: self(type="RandomObject *")
@@ -184,7 +185,7 @@ random() -> x in the interval [0, 1).
184
185
185
186
static PyObject *
186
187
_random_Random_random_impl (RandomObject * self )
187
- /*[clinic end generated code: output=117ff99ee53d755c input=afb2a59cbbb00349 ]*/
188
+ /*[clinic end generated code: output=117ff99ee53d755c input=26492e52d26e8b7b ]*/
188
189
{
189
190
uint32_t a = genrand_uint32 (self )>>5 , b = genrand_uint32 (self )>>6 ;
190
191
return PyFloat_FromDouble ((a * 67108864.0 + b )* (1.0 /9007199254740992.0 ));
@@ -368,6 +369,7 @@ random_seed(RandomObject *self, PyObject *arg)
368
369
}
369
370
370
371
/*[clinic input]
372
+ @critical_section
371
373
_random.Random.seed
372
374
373
375
self: self(type="RandomObject *")
@@ -382,7 +384,7 @@ of the current time and the process identifier.
382
384
383
385
static PyObject *
384
386
_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 ]*/
386
388
{
387
389
if (random_seed (self , n ) < 0 ) {
388
390
return NULL ;
@@ -391,6 +393,7 @@ _random_Random_seed_impl(RandomObject *self, PyObject *n)
391
393
}
392
394
393
395
/*[clinic input]
396
+ @critical_section
394
397
_random.Random.getstate
395
398
396
399
self: self(type="RandomObject *")
@@ -400,7 +403,7 @@ getstate() -> tuple containing the current state.
400
403
401
404
static PyObject *
402
405
_random_Random_getstate_impl (RandomObject * self )
403
- /*[clinic end generated code: output=bf6cef0c092c7180 input=b937a487928c0e89 ]*/
406
+ /*[clinic end generated code: output=bf6cef0c092c7180 input=b6621f31eb639694 ]*/
404
407
{
405
408
PyObject * state ;
406
409
PyObject * element ;
@@ -428,6 +431,7 @@ _random_Random_getstate_impl(RandomObject *self)
428
431
429
432
430
433
/*[clinic input]
434
+ @critical_section
431
435
_random.Random.setstate
432
436
433
437
self: self(type="RandomObject *")
@@ -438,8 +442,8 @@ setstate(state) -> None. Restores generator state.
438
442
[clinic start generated code]*/
439
443
440
444
static 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 ]*/
443
447
{
444
448
int i ;
445
449
unsigned long element ;
@@ -479,7 +483,7 @@ _random_Random_setstate(RandomObject *self, PyObject *state)
479
483
}
480
484
481
485
/*[clinic input]
482
-
486
+ @critical_section
483
487
_random.Random.getrandbits
484
488
485
489
self: self(type="RandomObject *")
@@ -491,7 +495,7 @@ getrandbits(k) -> x. Generates an int with k random bits.
491
495
492
496
static PyObject *
493
497
_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 ]*/
495
499
{
496
500
int i , words ;
497
501
uint32_t r ;
0 commit comments