Exercise with critical sections