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

Changeset 2405bb5 in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2012-08-15T19:28:43Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
7975433
Parents:
691d8d8
Message:

Forget active calls when a task exits.

  • Synchronization between answer and forget.
  • Forgotten calls are not yet properly cleaned-up.
  • Hold the sender task when processing its active calls.
File:
1 edited

Legend:

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

    r691d8d8 r2405bb5  
    420420        int rc = EOK;
    421421
     422        spinlock_lock(&answer->forget_lock);
     423        if (answer->forget) {
     424                /*
     425                 * This is a forgotten call and answer->sender is not valid.
     426                 */
     427                spinlock_unlock(&answer->forget_lock);
     428                /* TODO: free the call and its resources */
     429                return rc;
     430        } else {
     431                /*
     432                 * Hold the sender task so that it cannot suddenly disappear
     433                 * while we are working with it.
     434                 */
     435                task_hold(answer->sender);
     436        }
     437        spinlock_unlock(&answer->forget_lock);
     438
    422439        if ((native_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {
    423440                /* In case of forward, hangup the forwared phone,
     
    434451        }
    435452       
    436         if (!olddata)
     453        if (!olddata) {
     454                task_release(answer->sender);
    437455                return rc;
     456        }
    438457       
    439458        switch (IPC_GET_IMETHOD(*olddata)) {
     
    469488        }
    470489       
     490        task_release(answer->sender);
     491
    471492        return rc;
    472493}
Note: See TracChangeset for help on using the changeset viewer.