Make Threshold thread-safe