Changeset 78 for trunk/src/helpers/semaphores.c
- Timestamp:
- May 28, 2001, 9:47:12 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/semaphores.c
r77 r78 169 169 * I have created, this returns an APIRET. 170 170 * 171 *@@added V0.9.12 (2001-05-27) [umoeller]172 171 */ 173 172 … … 187 186 *@@ UnlockGlobal: 188 187 * 189 *@@added V0.9.12 (2001-05-27) [umoeller]190 188 */ 191 189 … … 258 256 * was set to NULLHANDLE. 259 257 * 260 * -- ERROR_SEM_BUSY: couldn't delete one 261 * of the member semaphores because they 262 * were held by some other thread. 263 */ 264 265 APIRET semDeleteRWMutex(PHRW phrw) 258 * -- ERROR_SEM_BUSY: semaphore is currently 259 * requested. 260 */ 261 262 APIRET semDeleteRWMutex(PHRW phrw) // in/out: rwsem handle 266 263 { 267 264 APIRET arc = NO_ERROR; … … 274 271 ) 275 272 { 276 if ( ( !(arc = DosCloseEventSem(pMutex->hevWriterDone)))277 && (!(arc = DosCloseEventSem(pMutex->hevReadersDone)))273 if ( (pMutex->cReaders) 274 || (pMutex->cWriters) 278 275 ) 276 arc = ERROR_SEM_BUSY; 277 else 279 278 { 280 ULONG cItems = pMutex->cReaderThreads; 281 TREE **papNodes = treeBuildArray(pMutex->ReaderThreadsTree, 282 &cItems); 283 if (papNodes) 279 if ( (!(arc = DosCloseEventSem(pMutex->hevWriterDone))) 280 && (!(arc = DosCloseEventSem(pMutex->hevReadersDone))) 281 ) 284 282 { 285 ULONG ul; 286 for (ul = 0; ul < cItems; ul++) 287 free(papNodes[ul]); 288 289 free(papNodes); 283 ULONG cItems = pMutex->cReaderThreads; 284 TREE **papNodes = treeBuildArray(pMutex->ReaderThreadsTree, 285 &cItems); 286 if (papNodes) 287 { 288 ULONG ul; 289 for (ul = 0; ul < cItems; ul++) 290 free(papNodes[ul]); 291 292 free(papNodes); 293 } 294 295 free(pMutex); 296 *phrw = NULLHANDLE; 290 297 } 291 292 free(pMutex);293 *phrw = NULLHANDLE;294 298 } 295 299 }
Note:
See TracChangeset
for help on using the changeset viewer.