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

Method SetUp

tests/unit_test/spinlock_test.cpp:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32class SpinLockTest : public ::testing::Test {
33 protected:
34 void SetUp() override {
35 shared_counter = 0;
36 thread_counter = 0;
37
38 // 初始化环境层
39 env_state_.InitializeCores(8); // 支持多核测试(最多 8 核)
40 env_state_.SetCurrentThreadEnvironment();
41 env_state_.BindThreadToCore(std::this_thread::get_id(), 0);
42 }
43
44 void TearDown() override {
45 // 清理环境

Callers

nothing calls this directly

Calls 3

InitializeCoresMethod · 0.80
BindThreadToCoreMethod · 0.80

Tested by

no test coverage detected