Changeset 7604 for trunk/src/kernel32/overlappedio.cpp
- Timestamp:
- Dec 10, 2001, 1:55:13 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/overlappedio.cpp
r7603 r7604 1 /* $Id: overlappedio.cpp,v 1.1 0 2001-12-10 11:29:01sandervl Exp $ */1 /* $Id: overlappedio.cpp,v 1.11 2001-12-10 12:55:12 sandervl Exp $ */ 2 2 3 3 /* … … 55 55 dprintf(("OverlappedIOThread: hEventRead %x hEventWrite %x hEventPoll %x", hEventRead, hEventWrite, hEventPoll)); 56 56 57 //the exit event semaphore is manual reset, because this event57 //the exit & cancel event semaphores are manual reset, because these events 58 58 //must be able to wake up multiple threads 59 59 hEventExit = ::CreateEventA(NULL, TRUE, FALSE, NULL); 60 if(!hEventPoll || !hEventRead || !hEventWrite || !hEventExit) 60 hEventCancel = ::CreateEventA(NULL, TRUE, FALSE, NULL); 61 if(!hEventPoll || !hEventRead || !hEventWrite || !hEventExit || !hEventCancel) 61 62 { 62 63 DebugInt3(); … … 254 255 255 256 case ASYNCIO_POLL: 256 hEventsWait[0] = lpRequest->hEventCancel;257 hEventsWait[0] = hEventCancel; 257 258 hEventsWait[1] = hEventExit; 258 259 ret = WAIT_TIMEOUT; … … 349 350 ::LeaveCriticalSection(&critsect); 350 351 351 lpOverlapped->Internal = ERROR_IO_PENDING;352 lpOverlapped->Internal = STATUS_PENDING; 352 353 lpOverlapped->InternalHigh = 0; 353 354 lpOverlapped->Offset = 0; … … 407 408 ::LeaveCriticalSection(&critsect); 408 409 409 lpOverlapped->Internal = ERROR_IO_PENDING;410 lpOverlapped->Internal = STATUS_PENDING; 410 411 lpOverlapped->InternalHigh = 0; 411 412 lpOverlapped->Offset = 0; … … 459 460 lpRequest->next = NULL; 460 461 461 lpOverlapped->Internal = ERROR_IO_PENDING;462 lpOverlapped->Internal = STATUS_PENDING; 462 463 lpOverlapped->InternalHigh = 0; 463 464 lpOverlapped->Offset = 0; … … 509 510 for(int i=ASYNC_INDEX_READ;i<NR_ASYNC_OPERATIONS;i++) 510 511 { 511 while(TRUE) { 512 while(TRUE) 513 { 512 514 lpRequest = findAndRemoveRequest(i, hHandle); 513 515 514 516 if(lpRequest) { 515 ::SetEvent(lpRequest->hEventCancel); //cancel pending operation 517 //TODO: This doesn't work if multiple handles share the 518 // same OverlappedIOHandler 519 lpRequest->fCancelled = TRUE; 520 ::SetEvent(hEventCancel); //cancel pending operation 516 521 if(i != ASYNC_INDEX_BUSY) {//thread that handles the request will delete it 517 522 delete lpRequest;
Note:
See TracChangeset
for help on using the changeset viewer.