summaryrefslogtreecommitdiff
path: root/bsd-core
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-09-09 07:45:12 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-09-09 07:45:12 +0000
commit6fc41e25e5acbbfae4d2e93a0d9e6f980f8ae477 (patch)
treee527134e5d867d79c4f03f798d60a480b50816f7 /bsd-core
parent4d6d3572029414419289fd512416effb9a9ad832 (diff)
Use spldrm/splx around tsleep() in DRM_WAIT_ONtrunk-20030912
Diffstat (limited to 'bsd-core')
-rw-r--r--bsd-core/drm_os_freebsd.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h
index 2addf2f46..a5049f548 100644
--- a/bsd-core/drm_os_freebsd.h
+++ b/bsd-core/drm_os_freebsd.h
@@ -204,11 +204,13 @@ do { \
#define DRM_HZ hz
-#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
-while (!condition) { \
- ret = tsleep( &(queue), PZERO | PCATCH, "drmwtq", (timeout) ); \
- if ( ret ) \
- return ret; \
+#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
+for ( ret = 0 ; !ret && !(condition) ; ) { \
+ int s = spldrm(); \
+ if (!(condition)) \
+ ret = tsleep( &(queue), PZERO | PCATCH, \
+ "drmwtq", (timeout) ); \
+ splx(s); \
}
#define DRM_WAKEUP( queue ) wakeup( queue )