| | 2439 | | pvm_notify(what, code, count, vals) |
| | 2440 | | int what; |
| | 2441 | | int code; |
| | 2442 | | int count; |
| | 2443 | | int *vals; |
| | 2444 | | { |
| | 2445 | | static struct timeval ztv = { 0, 0 }; |
| | 2446 | | |
| | 2447 | | int sbf; |
| | 2448 | | int cc; |
| | 2449 | | int numtid; |
| | 2450 | | int dosend = 0; |
| | 2451 | | struct waitc *wp; |
| | 2452 | | int flags; |
| | 2453 | | TEV_DECLS
|
| | 2454 | | |
| | 2455 | | if (TEV_EXCLUSIVE) {
|
| | 2456 | | if (TEV_DO_TRACE(TEV_NOTIFY,TEV_EVENT_ENTRY)) {
|
| | 2457 | | int tevcount; |
| | 2458 | | TEV_PACK_INT( TEV_DID_NE, TEV_DATA_SCALAR, &what, 1, 1 );
|
| | 2459 | | TEV_PACK_INT( TEV_DID_NMC, TEV_DATA_SCALAR, &code, 1, 1 );
|
| | 2460 | | tevcount = ( what != PvmHostAdd ) ? count : 0;
|
| | 2461 | | TEV_PACK_INT( TEV_DID_NTL, TEV_DATA_ARRAY,
|
| | 2462 | | vals, tevcount, 1 ); |
| | 2463 | | TEV_FIN;
|
| | 2464 | | } |
| | 2465 | | } |
| | 2466 | | |
| | 2467 | | flags = what; |
| | 2468 | | what &= ~PvmNotifyCancel;
|
| | 2469 | | |
| | 2470 | | if (!(cc = BEATASK)) {
|
| | 2471 | | if (!pvmrescode && (code & ~0x7fffffff)) { |
| | 2472 | | cc = PvmBadParam;
|
| | 2473 | | |
| | 2474 | | } else { |
| | 2475 | | switch (what) { |
| | 2476 | | |
| | 2477 | | case PvmHostDelete:
|
| | 2478 | | if (count < 1) |
| | 2479 | | cc = PvmBadParam;
|
| | 2480 | | else { |
| | 2481 | | numtid = count; |
| | 2482 | | dosend = 1; |
| | 2483 | | } |
| | 2484 | | break; |
| | 2485 | | |
| | 2486 | | case PvmTaskExit:
|
| | 2487 | | if (count < 1) |
| | 2488 | | cc = PvmBadParam;
|
| | 2489 | | else |
| | 2490 | | for (numtid = count; numtid-- > 0; ) |
| | 2491 | | if (!TIDISTASK(vals[numtid])) {
|
| | 2492 | | cc = PvmBadParam;
|
| | 2493 | | break; |
| | 2494 | | } |
| | 2495 | | if (!cc) { |
| | 2496 | | for (numtid = count; numtid-- > 0; ) |
| | 2497 | | if (vals[numtid] == pvmmytid) { |
| | 2498 | | wp = wait_new(WT_TASKX);
|
| | 2499 | | wp->wa_tid = pvmmytid; |
| | 2500 | | wp->wa_on = pvmmytid; |
| | 2501 | | sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
|
| | 2502 | | pvm_pkint(&pvmmytid, 1, 1); |
| | 2503 | | sbf = pvm_setsbuf(sbf); |