thinking in java concurrency update critical sections