| | 490 | | task_free(tp) |
| | 491 | | struct task *tp; |
| | 492 | | { |
| | 493 | | struct timeval now; |
| | 494 | | struct pmsg *mp; |
| | 495 | | struct ccon *cp; |
| | 496 | | |
| | 497 | | if (pvmdebmask & PDMTASK) {
|
| | 498 | | pvmlogprintf("task_free() t%x\n", tp->t_tid); |
| | 499 | | } |
| | 500 | | #ifdef SHMEM |
| | 501 | | |
| | 502 | | |
| | 503 | | |
| | 504 | | |
| | 505 | | mpp_free(tp->t_tid); |
| | 506 | | #endif |
| | 507 | | #ifdef IMA_BEOLIN |
| | 508 | | mpp_free(tp); |
| | 509 | | #endif |
| | 510 | | if (tp->t_plink && tp->t_prlink) { |
| | 511 | | LISTDELETE(tp, t_plink, t_prlink);
|
| | 512 | | } |
| | 513 | | if (tp->t_link && tp->t_rlink) { |
| | 514 | | LISTDELETE(tp, t_link, t_rlink);
|
| | 515 | | } |
| | 516 | | if (tp->t_rxm) |
| | 517 | | pmsg_unref(tp->t_rxm); |
| | 518 | | if (tp->t_rxp) |
| | 519 | | pk_free(tp->t_rxp); |
| | 520 | | if (tp->t_txq) |
| | 521 | | pk_free(tp->t_txq); |
| | 522 | | if (tp->t_wait) |
| | 523 | | wait_delete(tp->t_wait); |
| | 524 | | if (tp->t_authnam) { |
| | 525 | | (void)unlink(tp->t_authnam); |
| | 526 | | PVM_FREE(tp->t_authnam);
|
| | 527 | | } |
| | 528 | | if (tp->t_sock != -1) { |
| | 529 | | wrk_fds_delete(tp->t_sock, 3); |
| | 530 | | #ifdef WIN32 |
| | 531 | | closesocket(tp->t_sock); |
| | 532 | | #else |
| | 533 | | (void)close(tp->t_sock); |
| | 534 | | #endif |
| | 535 | | } |
| | 536 | | if (tp->t_out != -1) { |
| | 537 | | wrk_fds_delete(tp->t_out, 1); |
| | 538 | | #ifdef WIN32 |
| | 539 | | closesocket(tp->t_out); |
| | 540 | | #else |
| | 541 | | (void)close(tp->t_out); |
| | 542 | | #endif |
| | 543 | | } |
| | 544 | | if (tp->t_outtid > 0) { |