* Spawn the transfer tasks and then wait for them. Returns 0 on success, * -1 on failure. */
| 1535 | * -1 on failure. |
| 1536 | */ |
| 1537 | static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s) |
| 1538 | { |
| 1539 | pthread_t gtp_thread; |
| 1540 | pthread_t ptg_thread; |
| 1541 | int err; |
| 1542 | int ret = 0; |
| 1543 | err = pthread_create(>p_thread, NULL, udt_copy_task_routine, |
| 1544 | &s->gtp); |
| 1545 | if (err) |
| 1546 | die(_("can't start thread for copying data: %s"), strerror(err)); |
| 1547 | err = pthread_create(&ptg_thread, NULL, udt_copy_task_routine, |
| 1548 | &s->ptg); |
| 1549 | if (err) |
| 1550 | die(_("can't start thread for copying data: %s"), strerror(err)); |
| 1551 | |
| 1552 | ret |= tloop_join(gtp_thread, "Git to program copy"); |
| 1553 | ret |= tloop_join(ptg_thread, "Program to git copy"); |
| 1554 | return ret; |
| 1555 | } |
| 1556 | #else |
| 1557 | |
| 1558 | /* Close the source and target (for writing) for transfer. */ |
no test coverage detected