aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2011-11-04 09:19:18 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2011-11-04 09:19:18 +0000
commit87a133a7a56a13095181f18e55fcbd7a725d6aeb (patch)
tree6d637b952d6d60a602dee698a92dc644b14e165b /sys
parent2614c5c47c52aec94eb4990ba8ca5cc3ed43292a (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usb_process.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c
index 051ded993d96..70665053d4db 100644
--- a/sys/dev/usb/usb_process.c
+++ b/sys/dev/usb/usb_process.c
@@ -67,11 +67,13 @@ static int usb_pcount;
#define USB_THREAD_CREATE(f, s, p, ...) \
kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
0, "usb", __VA_ARGS__)
+#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
#define USB_THREAD_EXIT(err) kthread_exit()
#else
#define USB_THREAD_CREATE(f, s, p, ...) \
kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
+#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
#define USB_THREAD_EXIT(err) kthread_exit(err)
#endif
@@ -98,6 +100,9 @@ usb_process(void *arg)
struct usb_proc_msg *pm;
struct thread *td;
+ /* in case of attach error, check for suspended */
+ USB_THREAD_SUSPEND_CHECK();
+
/* adjust priority */
td = curthread;
thread_lock(td);