Changeset b1c57a8 in mainline for uspace/lib/c/generic/ipc.c


Ignore:
Timestamp:
2014-10-09T15:03:55Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e367939c
Parents:
21799398 (diff), 207e8880 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~adam-hraska+lp/helenos/rcu/.

Only merge from the feature branch and resolve all conflicts.

File:
1 edited

Legend:

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

    r21799398 rb1c57a8  
    8181LIST_INITIALIZE(queued_calls);
    8282
    83 static atomic_t ipc_futex = FUTEX_INITIALIZER;
     83static futex_t ipc_futex = FUTEX_INITIALIZER;
    8484
    8585/** Send asynchronous message via syscall.
     
    136136        if (!call) {
    137137                /* Nothing to do regardless if failed or not */
    138                 futex_up(&ipc_futex);
     138                futex_unlock(&ipc_futex);
    139139                return;
    140140        }
    141141       
    142142        if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
    143                 futex_up(&ipc_futex);
     143                futex_unlock(&ipc_futex);
    144144               
    145145                /* Call asynchronous handler with error code */
     
    152152       
    153153        if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
    154                 futex_up(&ipc_futex);
     154                futex_unlock(&ipc_futex);
    155155               
    156156                call->u.msg.phoneid = phoneid;
     
    175175        /* Add call to the list of dispatched calls */
    176176        list_append(&call->list, &dispatched_calls);
    177         futex_up(&ipc_futex);
     177        futex_unlock(&ipc_futex);
    178178}
    179179
     
    219219         */
    220220       
    221         futex_down(&ipc_futex);
     221        futex_lock(&ipc_futex);
    222222        ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid,
    223223            imethod, arg1, arg2, arg3, arg4);
     
    226226                if (!call) {
    227227                        call = ipc_prepare_async(private, callback);
    228                         if (!call)
     228                        if (!call) {
     229                                futex_unlock(&ipc_futex);
    229230                                return;
     231                        }
    230232                }
    231233               
     
    289291         */
    290292       
    291         futex_down(&ipc_futex);
     293        futex_lock(&ipc_futex);
    292294        ipc_callid_t callid =
    293295            ipc_call_async_internal(phoneid, &call->u.msg.data);
     
    384386                        call->u.callid = callid;
    385387                       
    386                         futex_down(&ipc_futex);
     388                        futex_lock(&ipc_futex);
    387389                        list_append(&call->list, &dispatched_calls);
    388                         futex_up(&ipc_futex);
     390                        futex_unlock(&ipc_futex);
    389391                }
    390392               
     
    412414        callid &= ~IPC_CALLID_ANSWERED;
    413415       
    414         futex_down(&ipc_futex);
     416        futex_lock(&ipc_futex);
    415417       
    416418        link_t *item;
     
    423425                        list_remove(&call->list);
    424426                       
    425                         futex_up(&ipc_futex);
     427                        futex_unlock(&ipc_futex);
    426428                       
    427429                        if (call->callback)
     
    434436        }
    435437       
    436         futex_up(&ipc_futex);
     438        futex_unlock(&ipc_futex);
    437439}
    438440
Note: See TracChangeset for help on using the changeset viewer.