From 3e01ad35171ba0bdc688ff98b9d0a2e432234d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 3 Nov 2007 13:39:39 +0000 Subject: [PATCH] Made DELAY() fall back to spin() for times below 1000 usecs; it's often used that way, and snooze() just wouldn't work right then. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22813 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/compat/freebsd_network/compat/sys/systm.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libs/compat/freebsd_network/compat/sys/systm.h b/src/libs/compat/freebsd_network/compat/sys/systm.h index 7f1a43c952..23ce13e76f 100644 --- a/src/libs/compat/freebsd_network/compat/sys/systm.h +++ b/src/libs/compat/freebsd_network/compat/sys/systm.h @@ -1,3 +1,7 @@ +/* + * Copyright 2007, Hugo Santos. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _FBSD_COMPAT_SYS_SYSTM_H_ #define _FBSD_COMPAT_SYS_SYSTM_H_ @@ -10,6 +14,12 @@ #include #include -#define DELAY(n) snooze(n) +#define DELAY(n) \ + do { \ + if (n < 1000) \ + spin(n); \ + else \ + snooze(n); \ + } while (0) -#endif +#endif /* _FBSD_COMPAT_SYS_SYSTM_H_ */