- Timestamp:
- May 27, 2007, 8:37:38 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/lib/sys/logstrict.c
r2796 r3371 611 611 static void __libc_logWrite(__LIBC_PLOGINST pInst, unsigned fGroupAndFlags, const char *pszMsg, size_t cch, int fStdErr) 612 612 { 613 APIRET rc; 613 APIRET rcSem; 614 APIRET rcMC; 615 ULONG ulIgnore = 0; 614 616 ULONG cb = 0; 615 617 HMTX hmtx = pInst->hmtx; … … 619 621 /* 620 622 * Aquire mutex ownership. 621 */ 622 rc = DosRequestMutexSem(hmtx, SEM_INDEFINITE_WAIT); 623 switch (rc) 624 { 625 case 0: 623 * We enter a must-complete section here to avoid getting interrupted 624 * while writing and creating deadlocks. 625 */ 626 rcMC = DosEnterMustComplete(&ulIgnore); 627 rcSem = DosRequestMutexSem(hmtx, 5000); 628 switch (rcSem) 629 { 630 case NO_ERROR: 626 631 break; 632 627 633 /* recreate the semaphore for some odd. */ 628 634 case ERROR_INVALID_HANDLE: … … 630 636 { 631 637 HMTX hmtxNew; 632 rc = DosCreateMutexSem(NULL, &hmtxNew, 0, TRUE);633 if (!rc )638 rcSem = DosCreateMutexSem(NULL, &hmtxNew, 0, TRUE); 639 if (!rcSem) 634 640 { 635 641 hmtx = __lxchg((int*)&pInst->hmtx, hmtxNew); … … 647 653 if (fGroupAndFlags & __LIBC_LOG_MSGF_FLUSH) 648 654 DosResetBuffer(pInst->hFile); 649 if (!rc )655 if (!rcSem) 650 656 DosReleaseMutexSem(pInst->hmtx); 657 if (!rcMC) 658 DosExitMustComplete(&ulIgnore); 651 659 FS_RESTORE(); 652 660
Note:
See TracChangeset
for help on using the changeset viewer.