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

Function ordering_second

tests/system_test/mutex_test.cpp:234–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void ordering_second(void* arg) {
235 auto* ctx = reinterpret_cast<OrderingArgs*>(arg);
236 (void)sys_sleep(30);
237 (void)ctx->mtx->Lock();
238 int prev = ctx->sequence->load();
239 ctx->sequence->store(ctx->task_id);
240 (void)ctx->mtx->UnLock();
241 if (prev != 1) {
242 klog::Err("ordering_second: first writer was {} not 1", prev);
243 }
244 sys_exit(0);
245}
246
247void test_mutex_ordering(void* /*arg*/) {
248 klog::Info("=== Mutex Ordering Test ===");

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected