Thread Safety
-------------

This function is safe to call from multiple threads.
