I've attached a patch with the corrections I mentioned upthread. I've gone ahead and run pgindent, though, I can't say that I'm very happy with the result.
I'm still not quite happy with the name BarrierArriveAndDetachExceptLast(). It's so literal. As you said, there probably isn't a nice name for this concept, since it is a function with the purpose of terminating parallelism.