chiark / gitweb /
rand.c, pgen.c: Invalidate random generators from pgen events.
I've not actually seen a crash from a Python program which keeps hold of
the random generator from a prime-generation event and tries to use it
after the operation has finished, but it was certainly possible.
Arrange for the event object to retain the random generator object (so
it always hands out the same one when requested), and invalidates it
when the event is itself invalidated.
This also involves messing with the `grand' code to cope with the idea
of invalidated random generators.