]> git.tdb.fi Git - r2c2.git/commit
Make sure Block::signal_reserved is emitted consistently
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Feb 2015 14:37:46 +0000 (16:37 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Feb 2015 14:48:23 +0000 (16:48 +0200)
commitece91e92af821bd6b468bd1134302efb7c28f019
tree9aac7cfe4adc1d6866d723f5d002d0e968f93fb0
parentace4d2175dce7364ff094b8dd44c53e47ba395b1
Make sure Block::signal_reserved is emitted consistently

Sigc++ apparently takes arguments as references, so if someone reached to
a signal with null train by reserving the block again, any remaining slots
of the release emission would also get the new train pointer.  This caused
the routing system to malfunction in certain cases as the router saw two
emissions for the same block reservation.

The simplest solution would be to pass t instead of train to emit(), but
then the ordering of the two emissions would be inconsistent.  Thus the
additional logic to delay further emissions until the outstanding one is
completed.
source/libr2c2/block.cpp
source/libr2c2/block.h