Barrier is now defined as a callback function.