- Timestamp:
- Mar 17, 2014, 5:20:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/lib/sys/sharedpm.c
r3805 r3851 551 551 SPM_ASSERT_PTR_NULL(pProcess->pPrev); 552 552 SPM_ASSERT_PTR_NULL(pProcess->pNext); 553 if ( pProcess->pidParent == pidParent 554 && pProcess->cReferences == 0 555 && uTimestamp - pProcess->uTimestamp >= 1*60*1000) 553 if ( pProcess->pidParent == pidParent 554 && pProcess->cReferences == 0 555 && ( uTimestamp - pProcess->uTimestamp >= 1*60*1000 556 || ( uTimestamp - pProcess->uTimestamp >= 8000 557 && pProcess->pid != -1 558 && DosVerifyPidTid(pProcess->pid, 1) == ERROR_INVALID_PROCID) 559 ) 560 ) 556 561 { 557 562 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext; … … 2716 2721 LIBCLOG_ENTER("pProcess=%p\n", (void *)pProcess); 2717 2722 LIBC_ASSERT(pProcess->enmState != __LIBC_PROCSTATE_FREE); 2723 2718 2724 /* 2719 2725 * Dereference it. … … 2741 2747 */ 2742 2748 /* inherited data */ 2743 if (pProcess->pInherit) 2744 { 2745 spmFree(pProcess->pInherit); 2749 void *pv = pProcess->pInheritLocked; 2750 if (!pv) 2751 pv = pProcess->pInherit; 2752 if (pv) 2753 { 2746 2754 pProcess->pInherit = NULL; 2755 pProcess->pInheritLocked = NULL; 2756 spmFree(pv); 2747 2757 } 2748 2758 … … 2895 2905 { 2896 2906 pProcess = pProcessBest; 2897 LIBCLOG_MSG("Found my embryo %p (pidParent=%#x pid=%#x cReferences=%d uTimestamp=%04x )\n",2898 (void *)pProcess, pProcess->pidParent, pProcess->pid, pProcess->cReferences, pProcess->uTimestamp );2907 LIBCLOG_MSG("Found my embryo %p (pidParent=%#x pid=%#x cReferences=%d uTimestamp=%04x pInherit=%p/%p)\n", 2908 (void *)pProcess, pProcess->pidParent, pProcess->pid, pProcess->cReferences, pProcess->uTimestamp, pProcess->pInherit, pProcess->pInheritLocked); 2899 2909 2900 2910 /* set data. */ … … 3084 3094 pProcess->pvForkHandle, (void *)pProcess->pNext, (void *)pProcess->pPrev); 3085 3095 /* 3096 * Free inheritance info. 3097 */ 3098 void *pv = pProcess->pInheritLocked; 3099 if (!pv) 3100 pv = pProcess->pInherit; 3101 if (pv) 3102 { 3103 pProcess->pInherit = NULL; 3104 pProcess->pInheritLocked = NULL; 3105 spmFree(pv); 3106 } 3107 3108 /* 3086 3109 * Free signals. 3087 3110 */ … … 3105 3128 pNotify = pNotify->pNext; 3106 3129 spmFreeChildNotify(pFree); 3130 } 3131 3132 /* 3133 * Parent notification. 3134 */ 3135 if (pProcess->pTerm) 3136 { 3137 spmFreeChildNotify(pProcess->pTerm); 3138 pProcess->pTerm = NULL; 3107 3139 } 3108 3140 … … 3485 3517 3486 3518 /* 3487 * Free embryos which are more than 5 min old .3519 * Free embryos which are more than 5 min old or which processes no longer exists. 3488 3520 */ 3489 3521 uTimestamp = spmTimestamp(); … … 3497 3529 SPM_ASSERT_PTR_NULL(pProcess->pPrev); 3498 3530 if ( pProcess->cReferences == 0 3499 && uTimestamp - pProcess->uTimestamp >= 5*60*1000) 3531 && ( uTimestamp - pProcess->uTimestamp >= 5*60*1000 3532 || ( pProcess->pid != -1 3533 && DosVerifyPidTid(pProcess->pid, 1) == ERROR_INVALID_PROCID) 3534 ) 3535 ) 3500 3536 { 3501 3537 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext;
Note:
See TracChangeset
for help on using the changeset viewer.