Date: Fri, 10 Sep 2010 23:55:28 +0000 (UTC) From: Weongyo Jeong <weongyo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r212444 - user/weongyo/usb/sys/dev/usb Message-ID: <201009102355.o8ANtSnL002337@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: weongyo Date: Fri Sep 10 23:55:27 2010 New Revision: 212444 URL: http://svn.freebsd.org/changeset/base/212444 Log: Uses mtx_sleep(9) instead of explicitly dropping the lock that it'll do the samething what we want to do. Modified: user/weongyo/usb/sys/dev/usb/usb_util.c Modified: user/weongyo/usb/sys/dev/usb/usb_util.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_util.c Fri Sep 10 23:49:33 2010 (r212443) +++ user/weongyo/usb/sys/dev/usb/usb_util.c Fri Sep 10 23:55:27 2010 (r212444) @@ -146,8 +146,7 @@ device_set_usb_desc(device_t dev) void usb_pause_mtx(struct mtx *mtx, int _ticks) { - if (mtx != NULL) - mtx_unlock(mtx); + int tmpchan; if (cold) { /* convert to milliseconds */ @@ -163,13 +162,12 @@ usb_pause_mtx(struct mtx *mtx, int _tick * too early! */ _ticks++; - - if (pause("USBWAIT", _ticks)) { - /* ignore */ - } + if (mtx != NULL) + (void)mtx_sleep(&tmpchan, mtx, USB_PRI_MED, "USBWAIT", + _ticks); + else + (void)pause("USBWAIT", _ticks); } - if (mtx != NULL) - mtx_lock(mtx); } /*------------------------------------------------------------------------*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009102355.o8ANtSnL002337>