| 696 | } |
| 697 | |
| 698 | static 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 | |
| 716 | static uint64_t ipc_now_ms(void) { |
| 717 | struct timespec now; |
no test coverage detected