From: Brian Norris Date: Sat, 10 Mar 2012 00:49:03 +0000 (-0800) Subject: schedule: set thread to NULL when there is no next thread X-Git-Tag: pldi2013~613 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=df08796eabfe4e40886318d0effb27f334abf8bf;p=model-checker.git schedule: set thread to NULL when there is no next thread --- diff --git a/schedule.c b/schedule.c index f5ce644..a4613c5 100644 --- a/schedule.c +++ b/schedule.c @@ -32,8 +32,10 @@ static void enqueue_thread(struct thread *t) static int dequeue_thread(struct thread **t) { - if (!head) + if (!head) { + *t = NULL; return -1; + } *t = head->this; head->live = 0; if (head == tail)