| 64 | } |
| 65 | |
| 66 | void TestEnvironmentState::BindThreadToCore(std::thread::id tid, |
| 67 | size_t core_id) { |
| 68 | std::lock_guard<std::mutex> lock(map_mutex_); |
| 69 | if (core_id >= cores_.size()) { |
| 70 | throw std::out_of_range("Invalid core_id: " + std::to_string(core_id)); |
| 71 | } |
| 72 | thread_to_core_map_[tid] = core_id; |
| 73 | cores_[core_id].thread_id = tid; |
| 74 | } |
| 75 | |
| 76 | auto TestEnvironmentState::GetCoreIdForThread(std::thread::id tid) -> size_t { |
| 77 | std::lock_guard<std::mutex> lock(map_mutex_); |