- Timestamp:
- May 18, 2008, 2:11:03 PM (18 years ago)
- Location:
- trunk/libc
- Files:
-
- 3 edited
-
include/InnoTekLIBC/sharedpm.h (modified) (1 diff)
-
src/kNIX/os2/__spawnve.c (modified) (2 diffs)
-
src/kNIX/os2/sharedpm.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/InnoTekLIBC/sharedpm.h
r2937 r3641 697 697 698 698 /** 699 700 701 702 703 704 705 706 707 699 708 * Searches for a process given by pid. 700 709 * -
trunk/libc/src/kNIX/os2/__spawnve.c
r3635 r3641 531 531 * If we figure that it's a libc child, we can wait a good deal longer. 532 532 */ 533 /** @todo add a SPM notification for when inherit is completed. */ 534 __LIBC_SPMLOADAVG LoadAvg; 535 unsigned uLoadAvgTS; 536 int fDoneInherit; 537 ULONG ulStart = fibGetMsCount(); 538 rc = 0; 539 while ( (fDoneInherit = pEmbryo->enmState >= __LIBC_PROCSTATE_ALIVE 540 || (pEmbryo->pInherit == NULL && pEmbryo->pInheritLocked == NULL) 541 ) == 0 542 && fibGetMsCount() - ulStart <= 8) 543 { 544 DosSleep(rc++ > 4); 545 __libc_spmGetLoadAvg(&LoadAvg, &uLoadAvgTS); /* SMP HACK */ 546 } 547 if ( !fDoneInherit 548 && pEmbryo->enmState == __LIBC_PROCSTATE_ALIVE) 549 { 550 LIBCLOG_MSG("libc child - wait some more (rc=%d)\n", rc); 551 rc = 0; 552 __libc_spmGetLoadAvg(&LoadAvg, &uLoadAvgTS); /* SMP HACK */ 553 while ( (fDoneInherit = pEmbryo->enmState >= __LIBC_PROCSTATE_ALIVE 554 || (pEmbryo->pInherit == NULL && pEmbryo->pInheritLocked == NULL) 555 ) == 0 556 && fibGetMsCount() - ulStart <= 100) 557 { 558 DosSleep(rc++ > 4); 559 __libc_spmGetLoadAvg(&LoadAvg, &uLoadAvgTS); /* SMP HACK */ 560 } 561 } 562 LIBCLOG_MSG("fDoneInherit=%d rc=%d enmState=%d inh=%p,%p - waited %d ms\n", 563 fDoneInherit, rc, pEmbryo->enmState, pEmbryo->pInherit, pEmbryo->pInheritLocked, fibGetMsCount() - ulStart); 533 int fDoneInherit = __libc_spmWaitForChildToBecomeAlive(pEmbryo); 534 LIBCLOG_MSG("fDoneInherit=%d enmState=%d inh=%p,%p\n", 535 fDoneInherit, pEmbryo->enmState, pEmbryo->pInherit, pEmbryo->pInheritLocked); 564 536 565 537 /* … … 634 606 { 635 607 LIBCLOG_MSG("waiting some more...\n"); 636 do 637 { 638 DosSleep(!(rc++ % 3)); 639 __libc_spmGetLoadAvg(&LoadAvg, &uLoadAvgTS); /* SMP HACK */ 640 fDoneInherit = pEmbryo->enmState > __LIBC_PROCSTATE_ALIVE 641 || (pEmbryo->pInherit == NULL && pEmbryo->pInheritLocked == NULL); 642 } while (!fDoneInherit 643 && fibGetMsCount() - ulStart <= 200); 644 LIBCLOG_MSG("fDoneInherit=%d rc=%d enmState=%d inh=%p,%p - waited %d ms\n", 645 fDoneInherit, rc, pEmbryo->enmState, pEmbryo->pInherit, pEmbryo->pInheritLocked, fibGetMsCount() - ulStart); 608 fDoneInherit = __libc_spmWaitForChildToBecomeAlive(pEmbryo); 609 LIBCLOG_MSG("fDoneInherit=%d enmState=%d inh=%p,%p\n", 610 fDoneInherit, pEmbryo->enmState, pEmbryo->pInherit, pEmbryo->pInheritLocked); 646 611 } 647 612 -
trunk/libc/src/kNIX/os2/sharedpm.c
r3373 r3641 25 25 * 26 26 */ 27 27 28 28 29 /** @todo … … 461 462 LIBC_ASSERTM(!gpSPMSelf->pInheritLocked, "Trying to free a locked inherit struct!\n"); 462 463 463 spmReleaseMutex(&RegRec); 464 LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify); 465 APIRET rc2 = DosPostEventSem(gpSPMHdr->hevNotify); 466 spmReleaseMutex(&RegRec); 467 LIBC_ASSERTM(!rc2, "rc2=%ld!\n", rc2); rc2 = rc2; 464 468 } 465 469 } … … 596 600 597 601 /** 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 598 691 * Searches for a process given by pid. 599 692 * … … 2282 2375 if (!gpSPMHdr->cSigMaxActive) 2283 2376 gpSPMHdr->cSigMaxActive = 1024; 2377 2378 2379 2380 2284 2381 } 2285 2382 else … … 2343 2440 { 2344 2441 /* 2345 * Register the current process and increment open counter. 2442 * Register the current process, increment open counter, 2443 * and notify everyone that spm data has changed. 2346 2444 */ 2347 2445 PLINFOSEG pLIS = GETLINFOSEG(); 2348 2446 spmRegisterSelf(pPib->pib_ulpid, pPib->pib_ulppid, pLIS->sgCurrent); 2349 2447 if (gpSPMSelf) 2448 2350 2449 gpSPMSelf->cSPMOpens++; 2450 2451 2452 2453 2454 2351 2455 2352 2456 /* … … 2529 2633 *pParent->ppChildNotifyTail = pTerm; 2530 2634 pParent->ppChildNotifyTail = &pTerm->pNext; 2531 DosPostEventSem(gpSPMHdr->hevNotify); 2635 2636 LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify); 2637 APIRET rc2 = DosPostEventSem(gpSPMHdr->hevNotify); 2638 LIBC_ASSERTM(!rc2, "rc2=%ld!\n", rc2); rc2 = rc2; 2532 2639 } 2533 2640 else … … 3151 3258 3152 3259 /* post notification sem. */ 3153 DosPostEventSem(gpSPMHdr->hevNotify); 3260 LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify); 3261 APIRET rc2 = DosPostEventSem(gpSPMHdr->hevNotify); 3262 LIBC_ASSERTM(!rc2, "rc2=%ld!\n", rc2); rc2 = rc2; 3154 3263 } 3155 3264 else … … 3353 3462 spmFreeProcess(pProcess); 3354 3463 pProcess = pProcessNext; 3464 3465 3466 3467 3468 3355 3469 continue; 3356 3470 } … … 3444 3558 spmFreeProcess(pProcess); 3445 3559 pProcess = pProcessNext; 3560 3561 3562 3563 3564 3446 3565 continue; 3447 3566 }
Note:
See TracChangeset
for help on using the changeset viewer.
