me->md.thr_bound_cpu = NULL;
_NT_IO_ABORT(PRInt32 sock){    PRThread *me = _PR_MD_CURRENT_THREAD();    PRBool fWait;    PRInt32 rv;    int loop_count;    /* This is a clumsy way to abort the IO, but it is all we can do.     * It looks a bit racy, but we handle all the cases.      * case 1:  IO completes before calling closesocket     *     case 1a:  fWait is set to PR_FALSE     *           This should e the most likely case.  We'll properly     *           not wait call _NT_IO_WAIT, since the closesocket()     *           won't be forcing a completion.     *     case 1b: fWait is set to PR_TRUE     *           This hopefully won't happen much.  When it does, this     *           thread will timeout in _NT_IO_WAIT for CLOSE_INTERVAL     *           before cleaning up.     * case 2:  IO does not complete before calling closesocket     *     case 2a: IO never completes     *           This is the likely case.  We'll close it and wait     *           for the completion forced by the close.  Return should     *           be immediate.     *     case 2b: IO completes just after calling closesocket     *           Since the closesocket is issued, we'll either get a     *           completion back for the real IO or for the close.  We     *           don't really care.  It may not even be possible to get     *           a real completion here.  In any event, we'll awaken     *           from NT_IO_WAIT immediately.     */    _PR_THREAD_LOCK(me);    fWait = me->io_pending;    if (fWait) {        /*         * If there's still I/O pending, it should have already timed         * out once before this function is called.         */        PR_ASSERT(me->io_suspended == PR_TRUE);        /* Set up to wait for I/O completion again */        me->state = _PR_IO_WAIT;        me->io_suspended = PR_FALSE;    }    _PR_THREAD_UNLOCK(me);    /* Close the socket if there is one */    if (sock != INVALID_SOCKET) {        rv = closesocket((SOCKET)sock);    }    /* If there was I/O pending before the close, wait for it to complete */    if (fWait) {        /* Wait and wait for the I/O to complete */        for (loop_count = 0; fWait; ++loop_count) {            _NT_IO_WAIT(me, CLOSE_TIMEOUT);            _PR_THREAD_LOCK(me);            fWait = me->io_pending;            if (fWait) {                PR_ASSERT(me->io_suspended == PR_TRUE);                me->state = _PR_IO_WAIT;                me->io_suspended = PR_FALSE;            }            _PR_THREAD_UNLOCK(me);            if (loop_count > max_wait_loops) {                max_wait_loops = loop_count;            }        }        if (loop_count > 1) {            ++missing_completions;        }        me->io_pending = PR_FALSE;        me->state = _PR_RUNNING;    }    PR_ASSERT(me->io_pending == PR_FALSE);    me->io_suspended = PR_FALSE;    return rv;}