| 115 | } |
| 116 | |
| 117 | auto TestEnvironmentState::FindTaskByContext(void* context_ptr) |
| 118 | -> TaskControlBlock* { |
| 119 | std::lock_guard<std::mutex> lock(map_mutex_); |
| 120 | auto it = context_to_task_map_.find(context_ptr); |
| 121 | if (it != context_to_task_map_.end()) { |
| 122 | return it->second; |
| 123 | } |
| 124 | return nullptr; |
| 125 | } |
| 126 | |
| 127 | void TestEnvironmentState::DumpAllCoreStates() const { |
| 128 | std::lock_guard<std::mutex> lock(map_mutex_); |