Add a comment.
Eliminate some excessive locking.
Get rid of more race conditions.