This is a situation where signal flags would be useful.