proccontrol: Don't reference thread states too early
authorJosh Stone <jistone@redhat.com>
Thu, 17 Jul 2014 21:26:55 +0000 (14:26 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 17 Jul 2014 21:26:55 +0000 (14:26 -0700)
commit0134fe0fe3a3cba7127836f3d9fb55172f26b7c9
tree7c42ad90935ffd0e68cf9cd383e058aee10ff988
parent4f7882e7d503f09e3b7650eadb324d75a200e917
proccontrol: Don't reference thread states too early

There was a chicken-and-egg in the int_thread constructor:

- int_thread calls the constructor for its first state.
- StateTracker calls its own setState.
- setState reads the up_thr handler and generator states,
  which aren't initialized yet!

Thankfully it didn't actually use those uninitized states unless
up_thr->up_thread is set, which isn't until after the initializer
list is done.  So it was harmless, but technically undefined behavior.

The fix is to not even read the generator and handler states until
up_thread is set.
proccontrol/src/process.C