| | 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"); |
| | 1979 | | return 0; |
| | 1980 | | } |
| | 1981 | | |
| | 1982 | | if (flags & PvmNotifyCancel) {
|
| | 1983 | | FORLIST (wp, waitlist, wa_link)
|
| | 1984 | | if (wp->wa_kind == WT_TASKX
|
| | 1985 | | && wp->wa_on == tid |
| | 1986 | | && wp->wa_tid == tp->t_tid |
| | 1987 | | && wp->wa_mesg->m_ctx == ctx |
| | 1988 | | && wp->wa_mesg->m_tag == tag) |
| | 1989 | | break; |
| | 1990 | | if (wp != waitlist) { |
| | 1991 | | sendmessage(wp->wa_mesg); |
| | 1992 | | wp->wa_mesg = 0; |
| | 1993 | | if ((hp = tidtohost(hosts, tid)) |
| | 1994 | | && hp->hd_hostpart != myhostpart) |
| | 1995 | | wp->wa_tid = 0; |
| | 1996 | | else |
| | 1997 | | wait_delete(wp); |
| | 1998 | | } |
| | 1999 | | |
| | 2000 | | } else { |
| | 2001 | | |
| | 2002 | | |