From cf4cc8a444d3c85367b9aa15b91b2829220e2edf Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Wed, 3 Oct 2012 15:36:26 -0700
Subject: [PATCH] model: do not assume THREAD_FINISH is always the last action

It's possible that there will be special fixup ModelActions added, so
just use the Thread::is_complete() method to check for a completed
Thread.
---
 model.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/model.cc b/model.cc
index 788a670..326358e 100644
--- a/model.cc
+++ b/model.cc
@@ -1246,7 +1246,7 @@ bool ModelChecker::release_seq_head(const ModelAction *rf, rel_heads_list_t *rel
 
 		ModelAction *last = get_last_action(int_to_id(i));
 		if (last && (rf->happens_before(last) ||
-				last->get_type() == THREAD_FINISH))
+				get_thread(int_to_id(i))->is_complete()))
 			future_ordered = true;
 
 		for (rit = list->rbegin(); rit != list->rend(); rit++) {
-- 
2.34.1