diff options
author | David Dawes <dawes@xfree86.org> | 2001-04-09 16:27:54 +0000 |
---|---|---|
committer | David Dawes <dawes@xfree86.org> | 2001-04-09 16:27:54 +0000 |
commit | 1759c16ab9b64598968a0058039e8a66bf5f9773 (patch) | |
tree | a82d44dc47302041daf1f5f408c6f47017baac47 /bsd/drm/lock.c | |
parent | 0e7f6c0726e5ff08eeab8e17a5aa63fbe44b3410 (diff) |
Import -f XFree86 4.0.99.2
Diffstat (limited to 'bsd/drm/lock.c')
-rw-r--r-- | bsd/drm/lock.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bsd/drm/lock.c b/bsd/drm/lock.c index 1affcd1d..ec295b2b 100644 --- a/bsd/drm/lock.c +++ b/bsd/drm/lock.c @@ -135,9 +135,12 @@ static int drm_flush_queue(drm_device_t *dev, int context) if (atomic_read(&q->use_count) > 1) { atomic_inc(&q->block_write); atomic_inc(&q->block_count); - error = tsleep(&q->flush_queue, PCATCH|PZERO, "drmfq", 0); - if (error) - return error; + for (;;) { + if (!DRM_BUFCOUNT(&q->waitlist)) break; + error = tsleep(&q->flush_queue, PCATCH|PZERO, "drmfq", 0); + if (error) + return error; + } atomic_dec(&q->block_count); } atomic_dec(&q->use_count); |