I think this exit may just be unnecessary synchronization? You'll have all the tasks get into `enter`, but then they'll all immediately stampede to `exit`, and then they'll all be allowed out. The code above is pretty small, so perhaps this could just be reimplemented in terms of the `enter` above? I do think that the barrier should be able to get re-used after tasks have exited the barrier, though.

What do you think about calling this function `wait` instead?