Added cases to use double-checked-locking.