dev: Fix race conditions at terminating dist-gem5 simulations
authorGabor Dozsa <gabor.dozsa@arm.com>
Tue, 6 Dec 2016 17:33:06 +0000 (17:33 +0000)
committerGabor Dozsa <gabor.dozsa@arm.com>
Tue, 6 Dec 2016 17:33:06 +0000 (17:33 +0000)
commitecf68fac40feb7dc5ba8eba5ebc7f07045b088bb
tree7b67fd36b1a81eed0ef49a95607aa467389f6fe4
parent3ef797623abaeb93049d59c8e90ba57f2ee9c7e1
dev: Fix race conditions at terminating dist-gem5 simulations

Two problems may arise when a distributed gem5 simulation terminates:
(i) simulation thread(s) may get stuck in an incomplete synchronisation
event which prohibits processing  the simulation exit event; and (ii) a
stale receiver thread may try to access objects that have already been
deleted while exiting gem5. This patch terminates receive threads properly
and aborts the processing of any incomplete synchronisation event.

Change-Id: I72337aa12c7926cece00309640d478b61e55a429
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
src/dev/net/dist_iface.cc
src/dev/net/dist_iface.hh