| 206 | } |
| 207 | |
| 208 | static 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 | |
| 221 | static bool bootstrap_fake_unlock(void *opaque, cbm_daemon_bootstrap_lock_t *lock_io) { |
| 222 | bootstrap_fake_ops_t *fake = opaque; |
nothing calls this directly
no outgoing calls
no test coverage detected