Support reentrance and asynchronous transitions

It is an error not to call this exactly once.