diff options
author | 2002-05-19 18:45:42 +0000 | |
---|---|---|
committer | 2002-05-19 18:45:42 +0000 | |
commit | 87b0f04ab953ce0f6e697e151f30896aebddfe59 (patch) | |
tree | cb2e99d8d82b8ead89ca4ac2567e9542061c790a | |
parent | enable attaching to a running process on alpha. (diff) | |
download | wireguard-openbsd-87b0f04ab953ce0f6e697e151f30896aebddfe59.tar.xz wireguard-openbsd-87b0f04ab953ce0f6e697e151f30896aebddfe59.zip |
Provide a correct timeout behaviour, fixes some panics people had been
experienting.
Discussed and brought to this shape by art@, drahn@ and myself.
-rw-r--r-- | sys/dev/usb/usb_port.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 1031618e4ab..70e08be1137 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_port.h,v 1.38 2002/05/09 15:06:29 nate Exp $ */ +/* $OpenBSD: usb_port.h,v 1.39 2002/05/19 18:45:42 miod Exp $ */ /* $NetBSD: usb_port.h,v 1.44 2001/05/14 20:35:29 bouyer Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -301,9 +301,13 @@ typedef struct device *device_ptr_t; } usb_dma_t typedef struct timeout usb_callout_t; -#define usb_callout_init(h) +#define usb_callout_init(h) timeout_set(&(h), NULL, NULL) #define usb_callout(h, t, f, d) \ - { timeout_set(&(h), (f), (d)); timeout_add(&(h), (t)); } + do { \ + timeout_del(&(h)); \ + timeout_set(&(h), (f), (d)); \ + timeout_add(&(h), (t)); \ + } while (0) #define usb_uncallout(h, f, d) timeout_del(&(h)) #define usb_lockmgr(l, f, sl, p) lockmgr((l), (f), (sl), (p)) |