Ignore:
Timestamp:
Jun 27, 2011, 5:14:44 PM (14 years ago)
Author:
dmik
Message:

wsock32: Don't start a dummy async thread when WSAEventSelect() is called to simply cancel a non-existing association on a socket. Since these calls are often made by applications before setting the socket to blocking mode even when no association on it has actually been created (per MSDN recommendations I suppose) and can occur at a frequent rate, this improvement may greatly reduce the number of async threads being created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/asyncapi.cpp

    r10428 r21656  
    747747        return NO_ERROR;
    748748   }
     749   if(lEventMask == 0) {
     750     // it's a call to cancel the non-existing association on this socket,
     751     // return shortly (existing associations are canceled by the "if" above)
     752     WSASetLastError(NO_ERROR);
     753     return NO_ERROR;
     754   }
     755
    749756   pThreadParm = (PASYNCTHREADPARM)malloc(sizeof(ASYNCTHREADPARM));
    750757   if(pThreadParm == NULL) {
Note: See TracChangeset for help on using the changeset viewer.