cpu.hh (8491:606cf2660887) | cpu.hh (8518:9c87727099ce) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * Copyright (c) 2011 Regents of the University of California 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 170 unchanged lines hidden (view full) --- 179 /** Schedule thread to activate , regardless of its current state. */ 180 void 181 scheduleActivateThreadEvent(ThreadID tid, int delay) 182 { 183 // Schedule thread to activate, regardless of its current state. 184 if (activateThreadEvent[tid].squashed()) 185 reschedule(activateThreadEvent[tid], 186 nextCycle(curTick() + ticks(delay))); | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * Copyright (c) 2011 Regents of the University of California 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 170 unchanged lines hidden (view full) --- 179 /** Schedule thread to activate , regardless of its current state. */ 180 void 181 scheduleActivateThreadEvent(ThreadID tid, int delay) 182 { 183 // Schedule thread to activate, regardless of its current state. 184 if (activateThreadEvent[tid].squashed()) 185 reschedule(activateThreadEvent[tid], 186 nextCycle(curTick() + ticks(delay))); |
187 else if (!activateThreadEvent[tid].scheduled()) 188 schedule(activateThreadEvent[tid], 189 nextCycle(curTick() + ticks(delay))); | 187 else if (!activateThreadEvent[tid].scheduled()) { 188 Tick when = nextCycle(curTick() + ticks(delay)); 189 190 // Check if the deallocateEvent is also scheduled, and make 191 // sure they do not happen at same time causing a sleep that 192 // is never woken from. 193 if (deallocateContextEvent[tid].scheduled() && 194 deallocateContextEvent[tid].when() == when) { 195 when++; 196 } 197 198 schedule(activateThreadEvent[tid], when); 199 } |
190 } 191 192 /** Unschedule actiavte thread event, regardless of its current state. */ 193 void 194 unscheduleActivateThreadEvent(ThreadID tid) 195 { 196 if (activateThreadEvent[tid].scheduled()) 197 activateThreadEvent[tid].squash(); --- 540 unchanged lines hidden --- | 200 } 201 202 /** Unschedule actiavte thread event, regardless of its current state. */ 203 void 204 unscheduleActivateThreadEvent(ThreadID tid) 205 { 206 if (activateThreadEvent[tid].scheduled()) 207 activateThreadEvent[tid].squash(); --- 540 unchanged lines hidden --- |