I think I would always check if notify_collector is not-NULL after the cond_wait returns. I am not sure how well defined the cond_wait semantics is - usually there can be spurious wakeups, hence it is always necessary to check the condition we're waiting on.