minor corrections to thread synchronization