check() happens under a writer lock, get() under a reader lock.
There are too many troubling possibilities for races otherwise. This also eliminates the arbitrary sleep time in the constructor.
Showing
Please register or sign in to comment