From 9dd9e3c4cc170185e5bbdb7b49eb21c553b9b4fc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 6 Apr 2010 09:14:53 +0000 Subject: [PATCH] Fix bug in popRunQueue --- rts/Schedule.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/Schedule.h b/rts/Schedule.h index 1e786ce..7760e36 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -155,7 +155,9 @@ popRunQueue (Capability *cap) StgTSO *t = cap->run_queue_hd; ASSERT(t != END_TSO_QUEUE); cap->run_queue_hd = t->_link; - cap->run_queue_hd->block_info.prev = END_TSO_QUEUE; + if (t->_link != END_TSO_QUEUE) { + t->_link->block_info.prev = END_TSO_QUEUE; + } t->_link = END_TSO_QUEUE; // no write barrier req'd if (cap->run_queue_hd == END_TSO_QUEUE) { cap->run_queue_tl = END_TSO_QUEUE; -- 1.7.10.4