If it isn't too expensive (it very likely is), the notion of blocking until the ML signal handler certainly sounds like it would be the nicest choice.