Changeset 2541646 in mainline


Ignore:
Timestamp:
2012-09-03T22:23:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c33f39f
Parents:
9c9bbaf
Message:

Do not slam phones of potentially long gone forwarder tasks.
Instead, slam the caller's phone, if it is still connected.

File:
1 edited

Legend:

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

    r9c9bbaf r2541646  
    199199
    200200        if ((native_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {
    201                 /* In case of forward, hangup the forwared phone,
    202                  * not the originator
    203                  */
    204                 mutex_lock(&answer->data.phone->lock);
    205                 irq_spinlock_lock(&TASK->answerbox.lock, true);
    206                 if (answer->data.phone->state == IPC_PHONE_CONNECTED) {
    207                         list_remove(&answer->data.phone->link);
    208                         answer->data.phone->state = IPC_PHONE_SLAMMED;
     201                phone_t *phone = answer->caller_phone;
     202                mutex_lock(&phone->lock);
     203                if (phone->state == IPC_PHONE_CONNECTED) {
     204                        irq_spinlock_lock(&phone->callee->lock, true);
     205                        list_remove(&phone->link);
     206                        phone->state = IPC_PHONE_SLAMMED;
     207                        irq_spinlock_unlock(&phone->callee->lock, true);
    209208                }
    210                 irq_spinlock_unlock(&TASK->answerbox.lock, true);
    211                 mutex_unlock(&answer->data.phone->lock);
     209                mutex_unlock(&phone->lock);
    212210        }
    213211       
Note: See TracChangeset for help on using the changeset viewer.