Changeset 86939b1 in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2012-08-13T14:12:19Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1cb75de
Parents:
cfaa35a
Message:

Maintain task's active calls in the active call list.

  • The call is placed on the list when sent and removed when the answer is picked up by the task.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    rcfaa35a r86939b1  
    230230        call->data.phone = phone;
    231231        atomic_inc(&phone->active_calls);
     232
     233        spinlock_lock(&TASK->active_calls_lock);
     234        list_append(&call->ta_link, &TASK->active_calls);
     235        spinlock_unlock(&TASK->active_calls_lock);
     236
    232237        IPC_SET_RETVAL(call->data, err);
    233238        _ipc_answer_free_call(call, false);
     
    250255        if (!(call->flags & IPC_CALL_FORWARDED)) {
    251256                atomic_inc(&phone->active_calls);
     257
     258                spinlock_lock(&TASK->active_calls_lock);
     259                list_append(&call->ta_link, &TASK->active_calls);
     260                spinlock_unlock(&TASK->active_calls_lock);
     261
    252262                call->data.phone = phone;
    253263                call->data.task_id = TASK->taskid;
     
    419429                list_remove(&request->ab_link);
    420430                atomic_dec(&request->data.phone->active_calls);
     431
     432                /*
     433                 * Remove the call from this task's active call list.
     434                 */
     435                spinlock_lock(&TASK->active_calls_lock);
     436                list_remove(&request->ta_link);
     437                spinlock_unlock(&TASK->active_calls_lock);
    421438        } else if (!list_empty(&box->calls)) {
    422439                /* Count received call */
Note: See TracChangeset for help on using the changeset viewer.