diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2017-02-19 05:30:31 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2017-02-19 05:30:31 -0500 |
commit | 184c6d7ebd7faa0869f294526a54a239a216b7c8 (patch) | |
tree | 136ca9e844392f986649f571c43393ef77a687ca /src/sim/drain.hh | |
parent | 912b20d02a4ec12b076e675ff150e3f1e89febaa (diff) | |
download | gem5-184c6d7ebd7faa0869f294526a54a239a216b7c8.tar.xz |
sim: Ensure draining is deterministic
The traversal of drainable objects could potentially be
non-deterministic when using an unordered set containing object
pointers. To ensure that the iteration is deterministic, we switch to
a vector. Note that the lookup and traversal of the drainable objects
is not performance critical, so the change has no negative consequences.
Diffstat (limited to 'src/sim/drain.hh')
-rw-r--r-- | src/sim/drain.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/drain.hh b/src/sim/drain.hh index b3145e7ed..663946616 100644 --- a/src/sim/drain.hh +++ b/src/sim/drain.hh @@ -42,7 +42,7 @@ #include <atomic> #include <mutex> -#include <unordered_set> +#include <vector> class Drainable; @@ -162,7 +162,7 @@ class DrainManager mutable std::mutex globalLock; /** Set of all drainable objects */ - std::unordered_set<Drainable *> _allDrainable; + std::vector<Drainable *> _allDrainable; /** * Number of objects still draining. This is flagged atomic since |