proccontrol: Avoid a destructor race on Counter::locks
authorJosh Stone <jistone@redhat.com>
Fri, 16 May 2014 22:57:00 +0000 (15:57 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 16 May 2014 22:57:00 +0000 (15:57 -0700)
commit7b83209fc18ffcd7fdd2628a3a10780bf9247f74
tree6aa59dc484fa9512f00040c2d6bf002b928f9559
parent053e46c90c4b14fe712c96569e502462dc82e0f7
proccontrol: Avoid a destructor race on Counter::locks

Previously, if process.C ran its destructors before generator.C, then
Counter::locks would be destroyed before int_cleanup.  The latter is
responsible for ending the handler thread, which may still be trying to
adjust locks.  Boost's mutex throws an exception if you try to acquire a
destroyed lock, which kills the whole process uncleanly.

Now the locks are created as a new[] pointer, and are simply leaked when
the process ends, no real harm done.
proccontrol/src/int_process.h
proccontrol/src/process.C