| | 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 | | |
| | | | ... |
| | 2509 | | dosend = 1; |
| | 2510 | | } |
| | 2511 | | break; |
| | 2512 | | |
| | 2513 | | case PvmHostAdd:
|
| | 2514 | | numtid = 0; |
| | 2515 | | vals = &numtid; |
| | 2516 | | dosend = 1; |
| | 2517 | | break; |
| | 2518 | | |
| | 2519 | | case PvmRouteAdd:
|
| | 2520 | | FORLIST (wp, waitlist, wa_link)
|
| | 2521 | | if (wp->wa_kind == WT_ROUTEA
|
| | 2522 | | && wp->wa_mesg->m_ctx == pvmmyctx |
| | 2523 | | && wp->wa_mesg->m_tag == code) |
| | 2524 | | break; |
| | 2525 | | |
| | 2526 | | if (count == 0 || (flags & PvmNotifyCancel)) {
|
| | 2527 | | if (wp != waitlist) |
| | 2528 | | wait_delete(wp); |
| | 2529 | | |
| | 2530 | | } else { |
| | 2531 | | if (wp == waitlist) { |
| | 2532 | | wp = wait_new(WT_ROUTEA);
|
| | 2533 | | wp->wa_tid = pvmmytid; |
| | 2534 | | wp->wa_on = pvmmytid; |
| | 2535 | | sbf = pvm_mkbuf(PvmDataFoo);
|