added thread-safe randmt32 functions