Changeset 103939e in mainline


Ignore:
Timestamp:
2019-08-06T20:15:57Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
0a8f070
Parents:
fb13b44
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-08-10 13:51:22)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 20:15:57)
Message:

Create EVENT_EXIT for task termination

Conflicts:

kernel/generic/src/proc/task.c
kernel/generic/src/proc/thread.c

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/event.h

    rfb13b44 r103939e  
    4444        /** A task/thread has faulted and will be terminated */
    4545        EVENT_FAULT,
     46        /** A task terminated (on its own or it was killed) */
     47        EVENT_EXIT,
    4648        /** New data available in kernel log */
    4749        EVENT_KLOG,
  • kernel/generic/src/proc/task.c

    rfb13b44 r103939e  
    586586/** Kill the currently running task.
    587587 *
    588  * @param notify Send out fault notifications.
     588 * @param fault Send out fault notifications.
    589589 *
    590590 * @return Zero on success or an error code from errno.h.
    591591 *
    592592 */
    593 void task_kill_self(bool notify)
     593void task_kill_self(bool fault)
    594594{
    595595        /*
     
    599599         * that's all you get.
    600600         */
    601         if (notify) {
     601        if (fault) {
    602602                /* Notify the subscriber that a fault occurred. */
    603603                if (event_notify_3(EVENT_FAULT, false, LOWER32(TASK->taskid),
     
    619619/** Process syscall to terminate the current task.
    620620 *
    621  * @param notify Send out fault notifications.
    622  *
    623  */
    624 sys_errno_t sys_task_exit(sysarg_t notify)
    625 {
    626         task_kill_self(notify);
     621 * @param fault Send out fault notifications.
     622 *
     623 */
     624sys_errno_t sys_task_exit(sysarg_t fault)
     625{
     626        task_kill_self(fault);
    627627        unreachable();
    628628}
  • kernel/generic/src/proc/thread.c

    rfb13b44 r103939e  
    522522                        sys_waitq_task_cleanup();
    523523                        LOG("Cleanup of task %" PRIu64 " completed.", TASK->taskid);
     524
     525                        /*
     526                         * Notify about task exit, it is meant to be signalled
     527                         * after any IPC cleanup operations. Ignore any errors.
     528                         */
     529                        (void)event_notify_2(EVENT_EXIT, false,
     530                            LOWER32(TASK->taskid), UPPER32(TASK->taskid));
    524531                }
    525532        }
Note: See TracChangeset for help on using the changeset viewer.