Changeset d48fcc0 in mainline for uspace/lib/usb/src/pipesio.c


Ignore:
Timestamp:
2011-04-09T09:45:14Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e9ce696
Parents:
a546687
Message:

Fine grain locking of USB pipes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/pipesio.c

    ra546687 rd48fcc0  
    8080
    8181        /* Ensure serialization over the phone. */
    82         pipe_acquire(pipe);
     82        pipe_start_transaction(pipe);
    8383
    8484        /*
     
    9191            NULL);
    9292        if (opening_request == 0) {
    93                 pipe_release(pipe);
     93                pipe_end_transaction(pipe);
    9494                return ENOMEM;
    9595        }
     
    106106         * without breaking the transfer IPC protocol.
    107107         */
    108         pipe_release(pipe);
     108        pipe_end_transaction(pipe);
    109109
    110110        if (data_request == 0) {
     
    227227
    228228        /* Ensure serialization over the phone. */
    229         pipe_acquire(pipe);
     229        pipe_start_transaction(pipe);
    230230
    231231        /*
     
    238238            NULL);
    239239        if (opening_request == 0) {
    240                 pipe_release(pipe);
     240                pipe_end_transaction(pipe);
    241241                return ENOMEM;
    242242        }
     
    251251         * without breaking the transfer IPC protocol.
    252252         */
    253         pipe_release(pipe);
     253        pipe_end_transaction(pipe);
    254254
    255255        if (rc != EOK) {
     
    326326{
    327327        /* Ensure serialization over the phone. */
    328         pipe_acquire(pipe);
     328        pipe_start_transaction(pipe);
    329329
    330330        /*
     
    346346            setup_buffer, setup_buffer_size);
    347347        if (rc != EOK) {
    348                 pipe_release(pipe);
     348                pipe_end_transaction(pipe);
    349349                async_wait_for(opening_request, NULL);
    350350                return rc;
     
    363363         * without breaking the transfer IPC protocol.
    364364         */
    365         pipe_release(pipe);
     365        pipe_end_transaction(pipe);
    366366
    367367
     
    468468{
    469469        /* Ensure serialization over the phone. */
    470         pipe_acquire(pipe);
     470        pipe_start_transaction(pipe);
    471471
    472472        /*
     
    480480            NULL);
    481481        if (opening_request == 0) {
    482                 pipe_release(pipe);
     482                pipe_end_transaction(pipe);
    483483                return ENOMEM;
    484484        }
     
    490490            setup_buffer, setup_buffer_size);
    491491        if (rc != EOK) {
    492                 pipe_release(pipe);
     492                pipe_end_transaction(pipe);
    493493                async_wait_for(opening_request, NULL);
    494494                return rc;
     
    503503
    504504                /* All data sent, pipe can be released. */
    505                 pipe_release(pipe);
     505                pipe_end_transaction(pipe);
    506506
    507507                if (rc != EOK) {
     
    511511        } else {
    512512                /* No data to send, we can release the pipe for others. */
    513                 pipe_release(pipe);
     513                pipe_end_transaction(pipe);
    514514        }
    515515
Note: See TracChangeset for help on using the changeset viewer.