Changeset c1f68b0 in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2017-10-28T11:40:41Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eca820c
Parents:
15d9fe6
Message:

Use recursive mutex to protect task_t::cap_info

This makes it possible to use the mutex-protected capability APIs even
inside caps_apply_to_kobject_type() callbacks. Now there is no need to
provide eg. cap_unpublish_locked() and cap_free_locked(). Likewise,
ipc_irq_unsubscribe() can be used when the task's cap_info is already
locked by the current thread inside of a callback.

File:
1 edited

Legend:

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

    r15d9fe6 rc1f68b0  
    829829{
    830830        ipc_phone_hangup(cap->kobject->phone);
    831         kobject_t *kobj = cap_unpublish_locked(cap->task, cap->handle,
     831        kobject_t *kobj = cap_unpublish(cap->task, cap->handle,
    832832            KOBJECT_TYPE_PHONE);
    833833        kobject_put(kobj);
    834         cap_free_locked(cap->task, cap->handle);
     834        cap_free(cap->task, cap->handle);
    835835        return true;
    836836}
     
    839839{
    840840        ipc_irq_unsubscribe(&TASK->answerbox, cap->handle);
    841         kobject_t *kobj = cap_unpublish_locked(cap->task, cap->handle,
    842             KOBJECT_TYPE_IRQ);
    843         kobject_put(kobj);
    844         cap_free_locked(cap->task, cap->handle);
    845841        return true;
    846842}
Note: See TracChangeset for help on using the changeset viewer.