locking support for random() prng