- Timestamp:
- Mar 17, 2014, 5:24:58 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/sharedpm.c
r3796 r3852 5 5 * 6 6 * Copyright (c) 2004 nickk 7 * Copyright (c) 2004-20 05knut st. osmundsen <bird-src-spam@anduin.net>7 * Copyright (c) 2004-2014 knut st. osmundsen <bird-src-spam@anduin.net> 8 8 * 9 9 * … … 514 514 SPM_ASSERT_PTR_NULL(pProcess->pPrev); 515 515 SPM_ASSERT_PTR_NULL(pProcess->pNext); 516 if ( pProcess->pidParent == pidParent 517 && pProcess->cReferences == 0 518 && uTimestamp - pProcess->uTimestamp >= 1*60*1000) 516 if ( pProcess->pidParent == pidParent 517 && pProcess->cReferences == 0 518 && ( uTimestamp - pProcess->uTimestamp >= 1*60*1000 519 || ( uTimestamp - pProcess->uTimestamp >= 8000 520 && pProcess->pid != -1 521 && DosVerifyPidTid(pProcess->pid, 1) == ERROR_INVALID_PROCID) 522 ) 523 ) 519 524 { 520 525 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext; … … 2673 2678 LIBCLOG_ENTER("pProcess=%p\n", (void *)pProcess); 2674 2679 LIBC_ASSERT(pProcess->enmState != __LIBC_PROCSTATE_FREE); 2680 2675 2681 /* 2676 2682 * Dereference it. … … 2698 2704 */ 2699 2705 /* inherited data */ 2700 if (pProcess->pInherit) 2701 { 2702 spmFree(pProcess->pInherit); 2706 void *pv = pProcess->pInheritLocked; 2707 if (!pv) 2708 pv = pProcess->pInherit; 2709 if (pv) 2710 { 2703 2711 pProcess->pInherit = NULL; 2712 pProcess->pInheritLocked = NULL; 2713 spmFree(pv); 2704 2714 } 2705 2715 … … 2852 2862 { 2853 2863 pProcess = pProcessBest; 2854 LIBCLOG_MSG("Found my embryo %p (pidParent=%#x pid=%#x cReferences=%d uTimestamp=%04x )\n",2855 (void *)pProcess, pProcess->pidParent, pProcess->pid, pProcess->cReferences, pProcess->uTimestamp );2864 LIBCLOG_MSG("Found my embryo %p (pidParent=%#x pid=%#x cReferences=%d uTimestamp=%04x pInherit=%p/%p)\n", 2865 (void *)pProcess, pProcess->pidParent, pProcess->pid, pProcess->cReferences, pProcess->uTimestamp, pProcess->pInherit, pProcess->pInheritLocked); 2856 2866 2857 2867 /* set data. */ … … 3041 3051 pProcess->pvForkHandle, (void *)pProcess->pNext, (void *)pProcess->pPrev); 3042 3052 /* 3053 * Free inheritance info. 3054 */ 3055 void *pv = pProcess->pInheritLocked; 3056 if (!pv) 3057 pv = pProcess->pInherit; 3058 if (pv) 3059 { 3060 pProcess->pInherit = NULL; 3061 pProcess->pInheritLocked = NULL; 3062 spmFree(pv); 3063 } 3064 3065 /* 3043 3066 * Free signals. 3044 3067 */ … … 3062 3085 pNotify = pNotify->pNext; 3063 3086 spmFreeChildNotify(pFree); 3087 } 3088 3089 /* 3090 * Parent notification. 3091 */ 3092 if (pProcess->pTerm) 3093 { 3094 spmFreeChildNotify(pProcess->pTerm); 3095 pProcess->pTerm = NULL; 3064 3096 } 3065 3097 … … 3442 3474 3443 3475 /* 3444 * Free embryos which are more than 5 min old .3476 * Free embryos which are more than 5 min old or which processes no longer exists. 3445 3477 */ 3446 3478 uTimestamp = spmTimestamp(); … … 3454 3486 SPM_ASSERT_PTR_NULL(pProcess->pPrev); 3455 3487 if ( pProcess->cReferences == 0 3456 && uTimestamp - pProcess->uTimestamp >= 5*60*1000) 3488 && ( uTimestamp - pProcess->uTimestamp >= 5*60*1000 3489 || ( pProcess->pid != -1 3490 && DosVerifyPidTid(pProcess->pid, 1) == ERROR_INVALID_PROCID) 3491 ) 3492 ) 3457 3493 { 3458 3494 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext;
Note:
See TracChangeset
for help on using the changeset viewer.