The classic solution would be to fork a special signal catching thread and play with the signal masks to ensure the signal goes there. This is what glib does if I recall correctly.
... Which of course seems very silly today. Signalfd is a much nicer API to use for new programs!