Resolve variable shadowing in process

This commit is contained in:
Chloe Marcec
2020-12-06 00:28:53 +11:00
parent b66a125823
commit 7631dca9ab

View File

@@ -179,12 +179,12 @@ void Process::InsertConditionVariableThread(std::shared_ptr<Thread> thread) {
void Process::RemoveConditionVariableThread(std::shared_ptr<Thread> thread) {
VAddr cond_var_addr = thread->GetCondVarWaitAddress();
std::list<std::shared_ptr<Thread>>& thread_list = cond_var_threads[cond_var_addr];
auto it = thread_list.begin();
while (it != thread_list.end()) {
std::list<std::shared_ptr<Thread>>& convar_thread_list = cond_var_threads[cond_var_addr];
auto it = convar_thread_list.begin();
while (it != convar_thread_list.end()) {
const std::shared_ptr<Thread> current_thread = *it;
if (current_thread.get() == thread.get()) {
thread_list.erase(it);
convar_thread_list.erase(it);
return;
}
++it;
@@ -194,9 +194,9 @@ void Process::RemoveConditionVariableThread(std::shared_ptr<Thread> thread) {
std::vector<std::shared_ptr<Thread>> Process::GetConditionVariableThreads(
const VAddr cond_var_addr) {
std::vector<std::shared_ptr<Thread>> result{};
std::list<std::shared_ptr<Thread>>& thread_list = cond_var_threads[cond_var_addr];
auto it = thread_list.begin();
while (it != thread_list.end()) {
std::list<std::shared_ptr<Thread>>& convar_thread_list = cond_var_threads[cond_var_addr];
auto it = convar_thread_list.begin();
while (it != convar_thread_list.end()) {
std::shared_ptr<Thread> current_thread = *it;
result.push_back(current_thread);
++it;