Changeset 1735f3e in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2010-01-31T18:22:37Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fc2e71e
Parents:
430de97 (diff), 2e07f62c (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 mainline.

File:
1 edited

Legend:

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

    r430de97 r1735f3e  
    212212 *
    213213 * @param call          Call structure to be answered.
    214  */
    215 static void _ipc_answer_free_call(call_t *call)
     214 * @param selflocked    If true, then TASK->answebox is locked.
     215 */
     216static void _ipc_answer_free_call(call_t *call, bool selflocked)
    216217{
    217218        answerbox_t *callerbox = call->callerbox;
     219        bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox));
    218220
    219221        call->flags |= IPC_CALL_ANSWERED;
     
    226228        }
    227229
    228         spinlock_lock(&callerbox->lock);
     230        if (do_lock)
     231                spinlock_lock(&callerbox->lock);
    229232        list_append(&call->link, &callerbox->answers);
    230         spinlock_unlock(&callerbox->lock);
     233        if (do_lock)
     234                spinlock_unlock(&callerbox->lock);
    231235        waitq_wakeup(&callerbox->wq, WAKEUP_FIRST);
    232236}
     
    244248        spinlock_unlock(&box->lock);
    245249        /* Send back answer */
    246         _ipc_answer_free_call(call);
     250        _ipc_answer_free_call(call, false);
    247251}
    248252
     
    261265        atomic_inc(&phone->active_calls);
    262266        IPC_SET_RETVAL(call->data, err);
    263         _ipc_answer_free_call(call);
     267        _ipc_answer_free_call(call, false);
    264268}
    265269
     
    300304                if (call->flags & IPC_CALL_FORWARDED) {
    301305                        IPC_SET_RETVAL(call->data, EFORWARD);
    302                         _ipc_answer_free_call(call);
     306                        _ipc_answer_free_call(call, false);
    303307                } else {
    304308                        if (phone->state == IPC_PHONE_HUNGUP)
     
    455459
    456460                IPC_SET_RETVAL(call->data, EHANGUP);
    457                 _ipc_answer_free_call(call);
     461                _ipc_answer_free_call(call, true);
    458462        }
    459463}
Note: See TracChangeset for help on using the changeset viewer.