Solution to  exercise 22-3 using sigwaitinfo