This does not even remotely look to be signal safe to me?
I also quite doubt that std::mutex, and even more so std::condition_variable are guaranteed to be signal safe.
You're right about mutex & cv in the general case though
FWIW I've run into malloc self dreadlocks due to rare signals plenty of time :(. In production workloads.
They are not. Use sem_t for signaling.
edit: also even if they where, the signal handler might wait forever for a mutex owned by the blocked thread.