Skip to main content

Clean up PRNG resources

Cleans up the global PRNG instance in a thread-safe manner. This function safely releases all PRNG resources, including thread-local storage, memory buffers, and cryptographic state.

Usage



cleanupPRNG()

Returns

Invisibly returns NULL PRNG createPRNG()Use the PRNG generatePRNG(10)Clean up when done cleanupPRNG()

Details

  • Thread safety: This function implements a two-phase cleanup process that first
  • disables threading to prevent new generations during cleanup, then releases all
  • resources in a controlled manner. This approach ensures memory safety even in
  • multi-threaded environments.