- Timestamp:
- Oct 7, 2002, 6:28:15 PM (23 years ago)
- Location:
- trunk/src/odincrt
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/odincrt/critsect.cpp
r8902 r9331 1 /* $Id: critsect.cpp,v 1. 5 2002-07-22 05:58:02 achimhaExp $ */1 /* $Id: critsect.cpp,v 1.6 2002-10-07 16:28:13 sandervl Exp $ */ 2 2 /* 3 3 * Critical sections in the Win32 sense … … 72 72 * DosInitializeCriticalSection 73 73 */ 74 VOIDWIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, PSZ pszSemName)74 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, PSZ pszSemName) 75 75 { 76 76 APIRET rc; … … 85 85 DebugInt3(); 86 86 crit->hmtxLock = 0; 87 return rc; 87 88 } 88 89 crit->Reserved = GetCurrentProcessId(); 90 return NO_ERROR; 89 91 } 90 92 … … 93 95 * DosAccessCriticalSection 94 96 */ 95 VOIDWIN32API DosAccessCriticalSection(CRITICAL_SECTION_OS2 *, PSZ pszSemName)97 ULONG WIN32API DosAccessCriticalSection(CRITICAL_SECTION_OS2 *, PSZ pszSemName) 96 98 { 97 99 HMTX hmtxLock = 0; … … 100 102 if(pszSemName == NULL) { 101 103 DebugInt3(); 102 return ;104 return ERROR_INVALID_PARAMETER; 103 105 } 104 106 … … 106 108 if(rc != NO_ERROR) { 107 109 DebugInt3(); 108 } 110 return rc; 111 } 112 return NO_ERROR; 109 113 } 110 114 /*********************************************************************** 111 115 * DosDeleteCriticalSection 112 116 */ 113 voidWIN32API DosDeleteCriticalSection( CRITICAL_SECTION_OS2 *crit )117 ULONG WIN32API DosDeleteCriticalSection( CRITICAL_SECTION_OS2 *crit ) 114 118 { 115 119 if (crit->hmtxLock) … … 126 130 crit->Reserved = (DWORD)-1; 127 131 } 132 return NO_ERROR; 128 133 } 129 134 … … 132 137 * DosEnterCriticalSection 133 138 */ 134 void WIN32API DosEnterCriticalSection( CRITICAL_SECTION_OS2 *crit )139 ULONG WIN32API DosEnterCriticalSection( CRITICAL_SECTION_OS2 *crit, ULONG ulTimeout ) 135 140 { 136 141 DWORD res; … … 151 156 { 152 157 crit->RecursionCount++; 153 return ;158 return NO_ERROR; 154 159 } 155 160 // do an atomic operation where we compare the owning thread id with 0 … … 162 167 163 168 /* Now wait for it */ 164 APIRET rc = DosWaitEventSem(crit->hmtxLock, SEM_INDEFINITE_WAIT);169 APIRET rc = DosWaitEventSem(crit->hmtxLock, ulTimeout); 165 170 if(rc != NO_ERROR) { 166 171 DebugInt3(); 167 return ;172 return rc; 168 173 } 169 174 DosResetEventSem(crit->hmtxLock, &ulnrposts); … … 175 180 crit->OwningThread = GetCurrentThreadId(); 176 181 crit->RecursionCount = 1; 182 return NO_ERROR; 177 183 } 178 184 … … 202 208 * DosLeaveCriticalSection 203 209 */ 204 void WIN32API DosLeaveCriticalSection( CRITICAL_SECTION_OS2 *crit ) 205 { 206 if (crit->OwningThread != GetCurrentThreadId()) return; 210 ULONG WIN32API DosLeaveCriticalSection( CRITICAL_SECTION_OS2 *crit ) 211 { 212 if (crit->OwningThread != GetCurrentThreadId()) { 213 DebugInt3(); 214 return ERROR_INVALID_PARAMETER; 215 } 207 216 208 217 if (--crit->RecursionCount) 209 218 { 210 219 DosInterlockedDecrement( &crit->LockCount ); 211 return ;220 return NO_ERROR; 212 221 } 213 222 crit->OwningThread = 0; … … 217 226 DosPostEventSem(crit->hmtxLock); 218 227 } 219 } 228 return NO_ERROR; 229 } -
trunk/src/odincrt/odin36.def
r8201 r9331 1 ; $Id: odin36.def,v 1. 5 2002-04-07 14:35:25sandervl Exp $1 ; $Id: odin36.def,v 1.6 2002-10-07 16:28:13 sandervl Exp $ 2 2 ; Odin VAC++ 3.6.5 shared multithreaded runtime 3 3 LIBRARY ODINCRT INITINSTANCE TERMINSTANCE … … 978 978 979 979 _DosDeleteCriticalSection@4 @1200 NONAME 980 _DosEnterCriticalSection@ 4@1201 NONAME980 _DosEnterCriticalSection@8 @1201 NONAME 981 981 _DosInitializeCriticalSection@8 @1202 NONAME 982 982 _DosAccessCriticalSection@8 @1203 NONAME -
trunk/src/odincrt/odin36d.def
r8201 r9331 1 ; $Id: odin36d.def,v 1. 5 2002-04-07 14:35:25sandervl Exp $1 ; $Id: odin36d.def,v 1.6 2002-10-07 16:28:14 sandervl Exp $ 2 2 ; Odin VAC++ 3.6.5 shared multithreaded runtime 3 3 LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE … … 986 986 987 987 _DosDeleteCriticalSection@4 @1200 NONAME 988 _DosEnterCriticalSection@ 4@1201 NONAME988 _DosEnterCriticalSection@8 @1201 NONAME 989 989 _DosInitializeCriticalSection@8 @1202 NONAME 990 990 _DosAccessCriticalSection@8 @1203 NONAME -
trunk/src/odincrt/odincrt.def
r8201 r9331 1 ; $Id: odincrt.def,v 1.2 5 2002-04-07 14:35:25sandervl Exp $1 ; $Id: odincrt.def,v 1.26 2002-10-07 16:28:14 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRT INITINSTANCE TERMINSTANCE … … 956 956 957 957 _DosDeleteCriticalSection@4 @1200 NONAME 958 _DosEnterCriticalSection@ 4@1201 NONAME958 _DosEnterCriticalSection@8 @1201 NONAME 959 959 _DosInitializeCriticalSection@8 @1202 NONAME 960 960 _DosAccessCriticalSection@8 @1203 NONAME -
trunk/src/odincrt/odincrtd.def
r8201 r9331 1 ; $Id: odincrtd.def,v 1. 6 2002-04-07 14:35:26sandervl Exp $1 ; $Id: odincrtd.def,v 1.7 2002-10-07 16:28:14 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE … … 958 958 959 959 _DosDeleteCriticalSection@4 @1200 NONAME 960 _DosEnterCriticalSection@ 4@1201 NONAME960 _DosEnterCriticalSection@8 @1201 NONAME 961 961 _DosInitializeCriticalSection@8 @1202 NONAME 962 962 _DosAccessCriticalSection@8 @1203 NONAME -
trunk/src/odincrt/odincrtp.def
r8201 r9331 1 ; $Id: odincrtp.def,v 1. 3 2002-04-07 14:35:26sandervl Exp $1 ; $Id: odincrtp.def,v 1.4 2002-10-07 16:28:15 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRTP INITINSTANCE TERMINSTANCE … … 979 979 980 980 _DosDeleteCriticalSection@4 @1200 NONAME 981 _DosEnterCriticalSection@ 4@1201 NONAME981 _DosEnterCriticalSection@8 @1201 NONAME 982 982 _DosInitializeCriticalSection@8 @1202 NONAME 983 983 _DosAccessCriticalSection@8 @1203 NONAME
Note:
See TracChangeset
for help on using the changeset viewer.