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

Function trylock_holder

tests/system_test/mutex_test.cpp:83–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81};
82
83void trylock_holder(void* arg) {
84 auto* ctx = reinterpret_cast<TryLockArgs*>(arg);
85 (void)ctx->mtx->Lock();
86 ctx->holder_locked.store(1);
87 (void)sys_sleep(200);
88 (void)ctx->mtx->UnLock();
89 ctx->holder_done.store(1);
90 sys_exit(0);
91}
92
93void test_mutex_trylock(void* /*arg*/) {
94 klog::Info("=== Mutex TryLock Test ===");

Callers

nothing calls this directly

Calls 4

sys_sleepFunction · 0.85
sys_exitFunction · 0.85
LockMethod · 0.45
UnLockMethod · 0.45

Tested by

no test coverage detected