MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / BindThreadToCore

Method BindThreadToCore

tests/unit_test/mocks/test_environment_state.cpp:66–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void 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
76auto TestEnvironmentState::GetCoreIdForThread(std::thread::id tid) -> size_t {
77 std::lock_guard<std::mutex> lock(map_mutex_);

Callers 8

SetUpMethod · 0.80
SetUpMethod · 0.80
TEST_FFunction · 0.80
SetUpMethod · 0.80
SetUpMethod · 0.80
SetUpMethod · 0.80
SetUpMethod · 0.80
SetUpMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected