It's being used in more places than just PreAndPostNotReentrantActionsWrapper, so it's better to move it to its own file.