Close a minor deadlock.

MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2014-01-17 08:21:09 +00:00
parent 0cfea1c8fc
commit c7d8c1c6e0

View file

@ -597,6 +597,13 @@ usb_fifo_free(struct usb_fifo *f)
mtx_unlock(f->priv_mtx);
mtx_lock(&usb_ref_lock);
/*
* Check if the "f->refcount" variable reached zero
* during the unlocked time before entering wait:
*/
if (f->refcount == 0)
break;
/* wait for sync */
cv_wait(&f->cv_drain, &usb_ref_lock);
}