terminate: Fix coutning of non-leader threads

Change-Id: I8399ad553bb8e09bef508ac976e8cd56cdae8013
This commit is contained in:
Masamichi Takagi
2018-09-02 17:02:17 +09:00
parent 0b0b7b03d7
commit be635ceb19

View File

@@ -1053,8 +1053,10 @@ void terminate(int rc, int sig)
mcs_rwlock_reader_lock(&proc->threads_lock, &lock); mcs_rwlock_reader_lock(&proc->threads_lock, &lock);
n = 0; n = 0;
list_for_each_entry(thread, &proc->threads_list, siblings_list) { list_for_each_entry(thread, &proc->threads_list, siblings_list) {
if (thread != mythread) {
n++; n++;
} }
}
if (n) { if (n) {
ids = kmalloc(sizeof(int) * n, IHK_MC_AP_NOWAIT); ids = kmalloc(sizeof(int) * n, IHK_MC_AP_NOWAIT);