MCPcopy Create free account
hub / github.com/git/git / finish_workers

Function finish_workers

parallel-checkout.c:504–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504static void finish_workers(struct pc_worker *workers, int num_workers)
505{
506 int i;
507
508 /*
509 * Close pipes before calling finish_command() to let the workers
510 * exit asynchronously and avoid spending extra time on wait().
511 */
512 for (i = 0; i < num_workers; i++) {
513 struct child_process *cp = &workers[i].cp;
514 if (cp->in >= 0)
515 close(cp->in);
516 if (cp->out >= 0)
517 close(cp->out);
518 }
519
520 for (i = 0; i < num_workers; i++) {
521 int rc = finish_command(&workers[i].cp);
522 if (rc > 128) {
523 /*
524 * For a normal non-zero exit, the worker should have
525 * already printed something useful to stderr. But a
526 * death by signal should be mentioned to the user.
527 */
528 error("checkout worker %d died of signal %d", i, rc - 128);
529 }
530 }
531
532 free(workers);
533}
534
535static inline void assert_pc_item_result_size(int got, int exp)
536{

Callers 1

run_parallel_checkoutFunction · 0.85

Calls 2

finish_commandFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected