Changeset 035d7d8 in mainline for uspace/srv/taskman/task.h


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/task.h

    r456f7ae r035d7d8  
    3535#define TASKMAN_TASK_H__
    3636
     37#include <abi/proc/task.h>
     38#include <adt/hash_table.h>
     39#include <adt/list.h>
     40#include <fibril_synch.h>
    3741#include <ipc/common.h>
    38 #include <abi/proc/task.h>
     42
     43/** What type of retval from the task we have */
     44typedef enum {
     45        RVAL_UNSET,     /**< unset */
     46        RVAL_SET,       /**< retval set, e.g. by server */
     47        RVAL_SET_EXIT   /**< retval set, wait for expected task exit */
     48} retval_t;
     49
     50/** Holds necessary information of each (registered) task. */
     51typedef struct {
     52        ht_link_t link;
     53       
     54        task_id_t id;          /**< Task id. */
     55        task_exit_t exit;      /**< Task's uspace exit status. */
     56        bool failed;           /**< Task failed (task can exit unexpectedly
     57                                    even w/out failure). */
     58        retval_t retval_type;  /**< Task returned a value. */
     59        int retval;            /**< The return value. */
     60
     61        link_t listeners;      /**< Link to listeners list. */
     62        async_sess_t *sess;    /**< Session for notifications to task. */
     63} task_t;
     64
     65extern hash_table_t task_hash_table;
     66extern fibril_rwlock_t task_hash_table_lock;
    3967
    4068extern int task_init(void);
    41 extern void process_pending_wait(void);
    4269
    43 extern void wait_for_task(task_id_t, int, ipc_callid_t, ipc_call_t *);
    44 extern int task_set_retval(ipc_call_t *);
     70extern task_t *task_get_by_id(task_id_t);
    4571
    4672extern int task_intro(ipc_call_t *, bool);
    47 extern void task_terminated(task_id_t, exit_reason_t);
    48 extern void task_failed(task_id_t);
    4973
    5074#endif
Note: See TracChangeset for help on using the changeset viewer.