| 1305 | } |
| 1306 | |
| 1307 | static bool main_version_cohort_close(cbm_version_cohort_lease_t **lease, |
| 1308 | cbm_version_cohort_manager_t **manager) { |
| 1309 | bool ok = true; |
| 1310 | uint64_t deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS); |
| 1311 | while (lease && *lease) { |
| 1312 | cbm_private_file_lock_status_t status = cbm_version_cohort_lease_release(lease); |
| 1313 | if (status != CBM_PRIVATE_FILE_LOCK_OK) { |
| 1314 | ok = false; |
| 1315 | } |
| 1316 | if (*lease) { |
| 1317 | if (cbm_now_ms() >= deadline) { |
| 1318 | main_coordination_cleanup_fail_stop("cohort_lease_cleanup"); |
| 1319 | } |
| 1320 | cbm_usleep(1000); |
| 1321 | } |
| 1322 | } |
| 1323 | deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS); |
| 1324 | while (manager && *manager) { |
| 1325 | cbm_private_file_lock_status_t status = cbm_version_cohort_manager_free(manager); |
| 1326 | if (status != CBM_PRIVATE_FILE_LOCK_OK) { |
| 1327 | ok = false; |
| 1328 | } |
| 1329 | if (*manager) { |
| 1330 | if (cbm_now_ms() >= deadline) { |
| 1331 | main_coordination_cleanup_fail_stop("cohort_manager_cleanup"); |
| 1332 | } |
| 1333 | cbm_usleep(1000); |
| 1334 | } |
| 1335 | } |
| 1336 | return ok; |
| 1337 | } |
| 1338 | |
| 1339 | static bool main_project_lock_manager_close(cbm_project_lock_manager_t **manager) { |
| 1340 | bool ok = true; |
no test coverage detected