curproc is null if no one is running, but ignore curproc unless wait is true