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

Function bootstrap_fake_lock

tests/test_daemon_bootstrap.c:208–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static int bootstrap_fake_lock(void *opaque, const cbm_daemon_ipc_endpoint_t *endpoint,
209 cbm_daemon_bootstrap_lock_t *lock_out) {
210 (void)endpoint;
211 bootstrap_fake_ops_t *fake = opaque;
212 atomic_fetch_add(&fake->lock_attempt_count, 1);
213 int expected = 0;
214 if (!atomic_compare_exchange_strong(&fake->lock_held, &expected, 1)) {
215 return 0;
216 }
217 *lock_out = fake;
218 return 1;
219}
220
221static bool bootstrap_fake_unlock(void *opaque, cbm_daemon_bootstrap_lock_t *lock_io) {
222 bootstrap_fake_ops_t *fake = opaque;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected