clockvector: bugfix - fixup vector initialization, size
authorBrian Norris <banorris@uci.edu>
Sat, 26 May 2012 03:28:58 +0000 (20:28 -0700)
committerBrian Norris <banorris@uci.edu>
Sat, 26 May 2012 03:37:54 +0000 (20:37 -0700)
commit8294305a6c0b9c0aa16485cf1d48f47200a8c8ab
tree9e9b9aa507984c14164112d16c0cf96d1bde2230
parent7ccfaf5b2ca3db6abb7312b0f4bb778be25cc17f
clockvector: bugfix - fixup vector initialization, size

This fixes a few bugs in ClockVector:

- The parent-less vector is the initial-thread creation, so set its vector
  clock[0] = 1
- The clock vector's data should be initialized to 0
- A clock vector cannot determine its size simply by the size of its parent (+1
  if 'act' is THREAD_CREATE); other threads could have been created, giving an
  inconsistent result here. Instead of trying to be smart about calculating
  num_threads from the parent, then, I just ask for it globally.
clockvector.cc