- Timestamp:
- May 27, 2007, 8:37:38 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/logstrict.c
r2929 r3371 592 592 static void __libc_logWrite(__LIBC_PLOGINST pInst, unsigned fGroupAndFlags, const char *pszMsg, size_t cch, int fStdErr) 593 593 { 594 APIRET rc; 594 APIRET rcSem; 595 APIRET rcMC; 596 ULONG ulIgnore = 0; 595 597 ULONG cb = 0; 596 598 HMTX hmtx = pInst->hmtx; … … 600 602 /* 601 603 * Aquire mutex ownership. 602 */ 603 rc = DosRequestMutexSem(hmtx, SEM_INDEFINITE_WAIT); 604 switch (rc) 605 { 606 case 0: 604 * We enter a must-complete section here to avoid getting interrupted 605 * while writing and creating deadlocks. 606 */ 607 rcMC = DosEnterMustComplete(&ulIgnore); 608 rcSem = DosRequestMutexSem(hmtx, 5000); 609 switch (rcSem) 610 { 611 case NO_ERROR: 607 612 break; 613 608 614 /* recreate the semaphore for some odd. */ 609 615 case ERROR_INVALID_HANDLE: … … 611 617 { 612 618 HMTX hmtxNew; 613 rc = DosCreateMutexSem(NULL, &hmtxNew, 0, TRUE);614 if (!rc )619 rcSem = DosCreateMutexSem(NULL, &hmtxNew, 0, TRUE); 620 if (!rcSem) 615 621 { 616 622 hmtx = __lxchg((int*)&pInst->hmtx, hmtxNew); … … 628 634 if (fGroupAndFlags & __LIBC_LOG_MSGF_FLUSH) 629 635 DosResetBuffer(pInst->hFile); 630 if (!rc )636 if (!rcSem) 631 637 DosReleaseMutexSem(pInst->hmtx); 638 if (!rcMC) 639 DosExitMustComplete(&ulIgnore); 632 640 FS_RESTORE(); 633 641
Note:
See TracChangeset
for help on using the changeset viewer.