Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0239846 in mainline


Ignore:
Timestamp:
2017-11-09T20:25:58Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
adb1ae9
Parents:
cbdb38ff
Message:

First wait for IPC answer and then end the async exchange

This is necessary to create a parallel locsrv connection (when handling
locsrv requests in parallel) instead of reusing the one which is still
possibly active.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/loc.c

    rcbdb38ff r0239846  
    247247        sysarg_t retval = async_data_write_start(exch, name, str_size(name));
    248248       
    249         loc_exchange_end(exch);
    250        
    251249        if (retval != EOK) {
    252250                async_forget(req);
    253                 return retval;
    254         }
    255        
    256         exch = loc_exchange_begin(INTERFACE_LOC_SUPPLIER);
     251                loc_exchange_end(exch);
     252                return retval;
     253        }
     254       
    257255        async_connect_to_me(exch, 0, 0, 0);
    258         loc_exchange_end(exch);
    259        
     256
     257        /*
     258         * First wait for the answer and then end the exchange. The opposite
     259         * order is generally wrong because it may lead to a deadlock under
     260         * certain circumstances.
     261         */
    260262        async_wait_for(req, &retval);
     263        loc_exchange_end(exch);
     264       
    261265        return retval;
    262266}
     
    276280        sysarg_t retval = async_data_write_start(exch, fqsn, str_size(fqsn));
    277281       
    278         loc_exchange_end(exch);
    279        
    280282        if (retval != EOK) {
    281283                async_forget(req);
    282                 return retval;
    283         }
    284        
     284                loc_exchange_end(exch);
     285                return retval;
     286        }
     287       
     288        /*
     289         * First wait for the answer and then end the exchange. The opposite
     290         * order is generally wrong because it may lead to a deadlock under
     291         * certain circumstances.
     292         */
    285293        async_wait_for(req, &retval);
     294        loc_exchange_end(exch);
    286295       
    287296        if (retval != EOK) {
Note: See TracChangeset for help on using the changeset viewer.