MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / try_lock_thread

Function try_lock_thread

tests/test_pipeline.c:19788–19798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19786static atomic_int g_thread_done = 0;
19787
19788static void *try_lock_thread(void *arg) {
19789 (void)arg;
19790 if (cbm_pipeline_try_lock()) {
19791 atomic_store(&g_thread_acquired, 1);
19792 cbm_pipeline_unlock();
19793 } else {
19794 atomic_store(&g_thread_acquired, 0);
19795 }
19796 atomic_store(&g_thread_done, 1);
19797 return NULL;
19798}
19799
19800TEST(pipeline_lock_contention) {
19801 /* Main thread holds lock, spawned thread should fail try_lock */

Callers

nothing calls this directly

Calls 2

cbm_pipeline_try_lockFunction · 0.85
cbm_pipeline_unlockFunction · 0.85

Tested by

no test coverage detected