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

Function process_lock_is_claimed

src/daemon/ipc.c:698–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698static int process_lock_is_claimed(const cbm_daemon_ipc_endpoint_t *endpoint,
699 const char *lock_name) {
700 if (!endpoint || !lock_name || pthread_mutex_lock(&process_locks_mutex) != 0) {
701 return -1;
702 }
703 int claimed = 0;
704 for (process_lock_entry_t *entry = process_locks; entry; entry = entry->next) {
705 if (entry->directory_device == endpoint->dir_device &&
706 entry->directory_inode == endpoint->dir_inode &&
707 strcmp(entry->lock_name, lock_name) == 0) {
708 claimed = 1;
709 break;
710 }
711 }
712 (void)pthread_mutex_unlock(&process_locks_mutex);
713 return claimed;
714}
715
716static uint64_t ipc_now_ms(void) {
717 struct timespec now;

Callers 3

posix_startup_lock_probeFunction · 0.85

Calls 1

pthread_mutex_lockFunction · 0.85

Tested by

no test coverage detected