Changeset 035d7d8 in mainline for uspace/srv/taskman/main.c


Ignore:
Timestamp:
2019-08-07T05:49:44Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
2aaccd3
Parents:
456f7ae
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-10-21 22:44:26)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-07 05:49:44)
Message:

taskman: Implement task event notifications

File:
1 edited

Legend:

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

    r456f7ae r035d7d8  
    3939#include <stdlib.h>
    4040
     41#include "event.h"
    4142#include "task.h"
    4243#include "taskman.h"
     
    6364       
    6465        if (rc != EOK) {
     66                printf(NAME ": %s -> %i\n", __func__, rc);
    6567                async_answer_0(iid, rc);
    6668                return;
     
    125127{
    126128        printf("%s:%i from %llu\n", __func__, __LINE__, icall->in_task_id);
    127         async_answer_0(iid, ENOTSUP); // TODO interrupt here
     129        /* Atomic -- will be used for notifications only */
     130        async_sess_t *sess = async_callback_receive(EXCHANGE_ATOMIC);
     131        if (sess == NULL) {
     132                async_answer_0(iid, ENOMEM);
     133                return;
     134        }
     135
     136        int rc = event_register_listener(icall->in_task_id, sess);
     137        async_answer_0(iid, rc);
    128138}
    129139
     
    268278                return rc;
    269279        }
     280        rc = event_init();
     281        if (rc != EOK) {
     282                return rc;
     283        }
    270284
    271285        rc = async_event_subscribe(EVENT_EXIT, task_exit_event, NULL);
Note: See TracChangeset for help on using the changeset viewer.