diff options
author | Tuan Ta <qtt2@cornell.edu> | 2018-04-02 16:21:37 -0400 |
---|---|---|
committer | Tuan Ta <qtt2@cornell.edu> | 2019-02-08 15:25:30 +0000 |
commit | bae0edb0d26dc6c4738855cf38e9a6a109ae8003 (patch) | |
tree | 28d8e6ce42a1bcf2c908542ddaafa37c995461b2 /src/cpu | |
parent | 72d1d2930fc2b8ef6d32ec2ce2eabbac00684159 (diff) | |
download | gem5-bae0edb0d26dc6c4738855cf38e9a6a109ae8003.tar.xz |
sim,cpu: make exit_group halt all threads in a group
When a thread calls exit_group, in addition to halting the thread
itself, it needs to halt all other threads in its group (i.e., threads
sharing the same thread group ID). This patch enables threads to do
that.
Change-Id: Ib2e158fb27cf98843f177a64a2d643b1bbc94d03
Reviewed-on: https://gem5-review.googlesource.com/c/9623
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/o3/cpu.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index e50741ec0..965ab04e0 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1861,9 +1861,8 @@ FullO3CPU<Impl>::addThreadToExitingList(ThreadID tid) { DPRINTF(O3CPU, "Thread %d is inserted to exitingThreads list\n", tid); - // make sure the thread is Active - assert(std::find(activeThreads.begin(), activeThreads.end(), tid) - != activeThreads.end()); + // the thread trying to exit can't be already halted + assert(tcBase(tid)->status() != ThreadContext::Halted); // make sure the thread has not been added to the list yet assert(exitingThreads.count(tid) == 0); |