| 501 | } |
| 502 | |
| 503 | static void process_lock_unclaim(process_lock_entry_t *claimed) { |
| 504 | if (!claimed || pthread_mutex_lock(&process_locks_mutex) != 0) { |
| 505 | return; |
| 506 | } |
| 507 | process_lock_entry_t **cursor = &process_locks; |
| 508 | while (*cursor && *cursor != claimed) { |
| 509 | cursor = &(*cursor)->next; |
| 510 | } |
| 511 | if (*cursor) { |
| 512 | *cursor = claimed->next; |
| 513 | free(claimed->lock_name); |
| 514 | free(claimed); |
| 515 | } |
| 516 | (void)pthread_mutex_unlock(&process_locks_mutex); |
| 517 | } |
| 518 | |
| 519 | static int process_lock_is_claimed(const cbm_daemon_ipc_endpoint_t *endpoint, |
| 520 | const char *lock_name) { |
no outgoing calls
no test coverage detected