eventq.cc (7451:97c34fea328a) | eventq.cc (7452:f98fe16f50ee) |
---|---|
1/* 2 * Copyright (c) 2000-2005 The Regents of The University of Michigan 3 * Copyright (c) 2008 The Hewlett-Packard Development Company 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 --- 219 unchanged lines hidden (view full) --- 228Event::unserialize(Checkpoint *cp, const string §ion) 229{ 230 if (scheduled()) 231 mainEventQueue.deschedule(this); 232 233 UNSERIALIZE_SCALAR(_when); 234 UNSERIALIZE_SCALAR(_priority); 235 | 1/* 2 * Copyright (c) 2000-2005 The Regents of The University of Michigan 3 * Copyright (c) 2008 The Hewlett-Packard Development Company 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 --- 219 unchanged lines hidden (view full) --- 228Event::unserialize(Checkpoint *cp, const string §ion) 229{ 230 if (scheduled()) 231 mainEventQueue.deschedule(this); 232 233 UNSERIALIZE_SCALAR(_when); 234 UNSERIALIZE_SCALAR(_priority); 235 |
236 // need to see if original event was in a scheduled, unsquashed 237 // state, but don't want to restore those flags in the current 238 // object itself (since they aren't immediately true) | |
239 short _flags; 240 UNSERIALIZE_SCALAR(_flags); | 236 short _flags; 237 UNSERIALIZE_SCALAR(_flags); |
238 239 // Old checkpoints had no concept of the Initialized flag 240 // so restoring from old checkpoints always fail. 241 // Events are initialized on construction but original code 242 // "flags = _flags" would just overwrite the initialization. 243 // So, read in the checkpoint flags, but then set the Initialized 244 // flag on top of it in order to avoid failures. |
|
241 assert(initialized()); 242 flags = _flags; 243 flags.set(Initialized); 244 | 245 assert(initialized()); 246 flags = _flags; 247 flags.set(Initialized); 248 |
249 // need to see if original event was in a scheduled, unsquashed 250 // state, but don't want to restore those flags in the current 251 // object itself (since they aren't immediately true) |
|
245 bool wasScheduled = flags.isSet(Scheduled) && !flags.isSet(Squashed); 246 flags.clear(Squashed | Scheduled); 247 248 if (wasScheduled) { 249 DPRINTF(Config, "rescheduling at %d\n", _when); 250 mainEventQueue.schedule(this, _when); 251 } 252} --- 164 unchanged lines hidden --- | 252 bool wasScheduled = flags.isSet(Scheduled) && !flags.isSet(Squashed); 253 flags.clear(Squashed | Scheduled); 254 255 if (wasScheduled) { 256 DPRINTF(Config, "rescheduling at %d\n", _when); 257 mainEventQueue.schedule(this, _when); 258 } 259} --- 164 unchanged lines hidden --- |