fixup 'int' vs. 'thread_id_t' usage
authorBrian Norris <banorris@uci.edu>
Fri, 12 Oct 2012 17:52:00 +0000 (10:52 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 12 Oct 2012 17:52:00 +0000 (10:52 -0700)
action.cc
nodestack.cc
schedule.cc

index 16f2327e8dc73de1ef564747bb27ae8c54c639fd..140d59098f8c37732753e4f80ddc58f8a883810b 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -492,7 +492,7 @@ unsigned int ModelAction::hash() const
        unsigned int hash=(unsigned int) this->type;
        hash^=((unsigned int)this->order)<<3;
        hash^=seq_number<<5;
-       hash^=tid<<6;
+       hash ^= id_to_int(tid) << 6;
 
        if (is_read()) {
                if (reads_from)
index ec7ce1694f764e640e099c9f2eb7a431c0b0763c..7471c744d1a19e5b57c3ebce764fbb754dc79b86 100644 (file)
@@ -51,7 +51,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness)
                                if (prevfi) {
                                        *fi=*prevfi;
                                }
-                               if (parent->is_enabled(i)) {
+                               if (parent->is_enabled(int_to_id(i))) {
                                        fi->enabled_count++;
                                }
                                if (i==currtid) {
@@ -60,7 +60,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness)
                                }
                                //Do window processing
                                if (prevfairness != NULL) {
-                                       if (prevfairness -> parent->is_enabled(i))
+                                       if (prevfairness -> parent->is_enabled(int_to_id(i)))
                                                fi->enabled_count--;
                                        if (i==prevtid) {
                                                fi->turns--;
index f68cb528a16b846a2f2653ecd3336b6ca496fee8..14e6475af1a781803647f7d3bd6fa56887ccf6d4 100644 (file)
@@ -148,7 +148,7 @@ Thread * Scheduler::next_thread(Thread *t)
                        thread_id_t curr_tid=int_to_id(curr_thread_index);
                        if (enabled[curr_thread_index]==THREAD_ENABLED&&
                                        (!have_enabled_thread_with_priority||n->has_priority(curr_tid))) {
-                               t = model->get_thread(int_to_id(curr_tid));
+                               t = model->get_thread(curr_tid);
                                break;
                        }
                        if (curr_thread_index == old_curr_thread) {