Changeset 5cd2290 in mainline for uspace/srv/taskman/main.c


Ignore:
Timestamp:
2019-08-07T05:35:46Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
b22b0a94
Parents:
1fb4a49
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-10-18 10:53:14)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-07 05:35:46)
Message:

taskman: Make use of EVENT_EXIT exit_reason parameter

  • Also improved handling of EVENT_FAULT — it only marks task as failed, waiters are notified after EVENT_EXIT happens.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/taskman/main.c

    r1fb4a49 r5cd2290  
    122122static void task_exit_event(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    123123{
    124         // TODO design substitution for taskmon (monitoring)
    125124        task_id_t id = MERGE_LOUP32(IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall));
    126         printf("%s:%i from %llu/%i\n", __func__, __LINE__, id, (task_exit_t)arg);
    127         task_terminated(id, (task_exit_t)arg);
     125        exit_reason_t exit_reason = IPC_GET_ARG3(*icall);
     126        printf("%s:%i from %llu/%i\n", __func__, __LINE__, id, exit_reason);
     127        task_terminated(id, exit_reason);
     128}
     129
     130static void task_fault_event(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     131{
     132        task_id_t id = MERGE_LOUP32(IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall));
     133        printf("%s:%i from %llu\n", __func__, __LINE__, id);
     134        task_failed(id);
    128135}
    129136
     
    254261        }
    255262
    256         rc = async_event_subscribe(EVENT_EXIT, task_exit_event, (void *)TASK_EXIT_NORMAL);
     263        rc = async_event_subscribe(EVENT_EXIT, task_exit_event, NULL);
    257264        if (rc != EOK) {
    258265                printf("Cannot register for exit events (%i).\n", rc);
     
    260267        }
    261268
    262         rc = async_event_subscribe(EVENT_FAULT, task_exit_event, (void *)TASK_EXIT_UNEXPECTED);
     269        rc = async_event_subscribe(EVENT_FAULT, task_fault_event, NULL);
    263270        if (rc != EOK) {
    264271                printf("Cannot register for fault events (%i).\n", rc);
Note: See TracChangeset for help on using the changeset viewer.