| | 1948 | | tm_notify(tp, mp) |
| | 1949 | | struct task *tp; |
| | 1950 | | struct pmsg *mp; |
| | 1951 | | { |
| | 1952 | | int what, flags, ctx, tag, count, tid; |
| | 1953 | | struct hostd *hp; |
| | 1954 | | struct pmsg *mp2; |
| | 1955 | | struct waitc *wp; |
| | 1956 | | int i; |
| | 1957 | | |
| | 1958 | | if (upkint(mp, &what) |
| | 1959 | | || upkint(mp, &ctx) |
| | 1960 | | || upkint(mp, &tag) |
| | 1961 | | || upkint(mp, &count)) { |
| | 1962 | | pvmlogerror("tm_notify() bad msg format\n"); |
| | 1963 | | return 0; |
| | 1964 | | } |
| | 1965 | | |
| | 1966 | | flags = what; |
| | 1967 | | what &= 0xff; |
| | 1968 | | switch (what) { |
| | 1969 | | |
| | 1970 | | |
| | 1971 | | |
| | 1972 | | |
| | 1973 | | |
| | 1974 | | |
| | 1975 | | case PvmTaskExit:
|
| | 1976 | | for (i = 0; i < count; i++) { |
| | 1977 | | if (upkuint(mp, &tid)) { |
| | 1978 | | pvmlogerror("tm_notify() bad msg format\n"); |
| | | | ... |
| | 2032 | | mp2->m_dst = hp->hd_hostpart | TIDPVMD;
|
| | 2033 | | mp2->m_tag = DM_NOTIFY;
|
| | 2034 | | mp2->m_wid = wp->wa_wid; |
| | 2035 | | sendmessage(mp2); |
| | 2036 | | } |
| | 2037 | | } |
| | 2038 | | } |
| | 2039 | | } |
| | 2040 | | break; |
| | 2041 | | |
| | 2042 | | case PvmHostDelete:
|
| | 2043 | | for (i = 0; i < count; i++) { |
| | 2044 | | if (upkuint(mp, &tid)) { |
| | 2045 | | pvmlogerror("tm_notify() bad msg format\n"); |
| | 2046 | | return 0; |
| | 2047 | | } |
| | 2048 | | if (flags & PvmNotifyCancel) {
|
| | 2049 | | if (hp = tidtohost(hosts, tid)) { |
| | 2050 | | FORLIST (wp, waitlist, wa_link)
|
| | 2051 | | if (wp->wa_kind == WT_HOSTF
|
| | 2052 | | && wp->wa_on == hp->hd_hostpart |
| | 2053 | | && wp->wa_tid == tp->t_tid |
| | 2054 | | && wp->wa_mesg->m_ctx == ctx |
| | 2055 | | && wp->wa_mesg->m_tag == tag) |
| | 2056 | | break; |
| | 2057 | | if (wp != waitlist) { |
| | 2058 | | sendmessage(wp->wa_mesg); |
| | 2059 | | wp->wa_mesg = 0; |
| | 2060 | | wait_delete(wp); |
| | 2061 | | } |
| | 2062 | | } |
| | 2063 | | |
| | 2064 | | } else { |