Make tree iterators safe under concurrency | Apple Interview Question