Changeset 10185 for trunk/src/odincrt/critsect.cpp
- Timestamp:
 - Jul 28, 2003, 1:35:32 PM (22 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/src/odincrt/critsect.cpp (modified) (11 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/odincrt/critsect.cpp
r9756 r10185 1 /* $Id: critsect.cpp,v 1. 8 2003-02-06 10:30:02sandervl Exp $ */1 /* $Id: critsect.cpp,v 1.9 2003-07-28 11:30:17 sandervl Exp $ */ 2 2 /* 3 3 * Critical sections in the Win32 sense 4 * 4 * 5 5 * Copyright 2002 Sander van Leeuwen <sandervl@innotek.de> 6 6 * … … 12 12 #include <win32type.h> 13 13 #include <win32api.h> 14 #include <FastInfoBlocks.h> 14 15 15 16 #include <assert.h> … … 23 24 #define DebugInt3() 24 25 #endif 26 25 27 26 28 //****************************************************************************** … … 42 44 inline ULONG GetCurrentThreadId() 43 45 { 46 #ifdef fibGetPid 47 return MAKE_THREADID(fibGetPid(), fibGetTid()); 48 #else 44 49 PTIB ptib; 45 50 PPIB ppib; 46 51 APIRET rc; 47 52 48 53 rc = DosGetInfoBlocks(&ptib, &ppib); 49 54 if(rc == NO_ERROR) { … … 57 62 DebugInt3(); 58 63 return 0; 64 #endif 59 65 } 60 66 //****************************************************************************** … … 62 68 inline ULONG GetCurrentProcessId() 63 69 { 70 #ifdef fibGetPid 71 return fibGetPid(); 72 #else 64 73 PTIB ptib; 65 74 PPIB ppib; 66 75 APIRET rc; 67 76 68 77 rc = DosGetInfoBlocks(&ptib, &ppib); 69 78 if(rc == NO_ERROR) { … … 72 81 DebugInt3(); 73 82 return 0; 83 #endif 74 84 } 75 85 … … 77 87 * DosInitializeCriticalSection 78 88 */ 79 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 89 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 80 90 PSZ pszSemName, BOOL fShared) 81 91 { … … 131 141 { 132 142 #ifdef DEBUG 133 if (crit->LockCount != -1 || crit->OwningThread || crit->RecursionCount) /* Should not happen */ 143 if ( (crit->LockCount != -1 && crit->CreationCount == 1) 144 || crit->OwningThread 145 || crit->RecursionCount) /* Should not happen */ 134 146 { 135 147 DebugInt3(); … … 181 193 ULONG ulnrposts; 182 194 183 // now wait for it 195 // now wait for it 184 196 APIRET rc = DosWaitEventSem(crit->hmtxLock, ulTimeout); 185 197 if(rc != NO_ERROR) { … … 206 218 return ERROR_INVALID_PARAMETER; 207 219 } 208 220 209 221 if (--crit->RecursionCount) 210 222 {  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  