done with priority-condvar