Thread-local mock support.