Make promises thread-safe