Here, we should move mutex_lock out of loop. ithread_cond_wait() unlocks the mutex on entry, and locks it on exit - so there is no need to unlock the mutex in UPnPVarChangeCollector_notify_* functions.