Made RandomPool more threadsafe