VirtualBox

Ignore:
Timestamp:
Jan 28, 2009 2:36:37 AM (16 years ago)
Author:
vboxsync
Message:

NAT: multi threading.
Introduces set of macroces to use locking/unlocking/creating/destroing mutexes
Also every socket enqueueing is accomponement with lock creation
(it doen't work yet, compilable on Windows don't know about Linux)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r16226 r16291  
    7272/*
    7373 * remque and free a socket, clobber cache
     74 * VBOX_WITH_SLIRP_MT: before sofree queue should be locked, because
     75 *      in sofree we don't know from which queue item beeing removed.
    7476 */
    7577void
     
    8789    if(so->so_next && so->so_prev)
    8890        remque(pData, so);  /* crashes if so is not in a queue */
     91
     92    SOCKET_UNLOCK(so);
     93    SOCKET_LOCK_DESTROY(so);
    8994
    9095    RTMemFree(so);
     
    644649        return NULL;
    645650    }
     651
     652    SOCKET_LOCK_CREATE(so);
     653    SOCKET_LOCK(so);
     654    QSOCKET_LOCK(tcb);
    646655    insque(pData, so,&tcb);
     656    QSOCKET_UNLOCK(tcb);
    647657
    648658    /*
     
    674684        int tmperrno = errno; /* Don't clobber the real reason we failed */
    675685        close(s);
     686        QSOCKET_LOCK(tcb);
    676687        sofree(pData, so);
     688        QSOCKET_UNLOCK(tcb);
    677689        /* Restore the real errno */
    678690        errno = tmperrno;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette