Changeset 814c4f5 in mainline for kernel/generic/src/proc/task.c


Ignore:
Timestamp:
2008-08-24T10:47:19Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
90a428a
Parents:
1c87d79
Message:

Improve comments in task.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/task.c

    r1c87d79 r814c4f5  
    7272static task_id_t task_counter = 0;
    7373
    74 /** Initialize tasks
    75  *
    76  * Initialize kernel tasks support.
    77  *
    78  */
     74/** Initialize kernel tasks support. */
    7975void task_init(void)
    8076{
     
    8480
    8581/*
    86  * The idea behind this walker is to remember a single task different from TASK.
     82 * The idea behind this walker is to remember a single task different from
     83 * TASK.
    8784 */
    8885static bool task_done_walker(avltree_node_t *node, void *arg)
     
    9996}
    10097
    101 /** Kill all tasks except the current task.
    102  *
    103  */
     98/** Kill all tasks except the current task. */
    10499void task_done(void)
    105100{
     
    133128}
    134129
    135 /** Create new task
    136  *
    137  * Create new task with no threads.
    138  *
    139  * @param as Task's address space.
    140  * @param name Symbolic name.
    141  *
    142  * @return New task's structure
     130/** Create new task with no threads.
     131 *
     132 * @param as            Task's address space.
     133 * @param name          Symbolic name.
     134 *
     135 * @return              New task's structure.
    143136 *
    144137 */
     
    195188/** Destroy task.
    196189 *
    197  * @param t Task to be destroyed.
     190 * @param t             Task to be destroyed.
    198191 */
    199192void task_destroy(task_t *t)
     
    228221/** Syscall for reading task ID from userspace.
    229222 *
    230  * @param uspace_task_id Userspace address of 8-byte buffer where to store
    231  * current task ID.
    232  *
    233  * @return 0 on success or an error code from @ref errno.h.
     223 * @param               uspace_task_id userspace address of 8-byte buffer
     224 *                      where to store current task ID.
     225 *
     226 * @return              Zero on success or an error code from @ref errno.h.
    234227 */
    235228unative_t sys_task_get_id(task_id_t *uspace_task_id)
    236229{
    237230        /*
    238          * No need to acquire lock on TASK because taskid
    239          * remains constant for the lifespan of the task.
     231         * No need to acquire lock on TASK because taskid remains constant for
     232         * the lifespan of the task.
    240233         */
    241234        return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,
     
    245238/** Find task structure corresponding to task ID.
    246239 *
    247  * The tasks_lock must be already held by the caller of this function
    248  * and interrupts must be disabled.
    249  *
    250  * @param id Task ID.
    251  *
    252  * @return Task structure address or NULL if there is no such task ID.
    253  */
    254 task_t *task_find_by_id(task_id_t id)
    255 {
    256         avltree_node_t *node;
     240 * The tasks_lock must be already held by the caller of this function and
     241 * interrupts must be disabled.
     242 *
     243 * @param id            Task ID.
     244 *
     245 * @return              Task structure address or NULL if there is no such task
     246 *                      ID.
     247 */
     248task_t *task_find_by_id(task_id_t id) { avltree_node_t *node;
    257249       
    258250        node = avltree_search(&tasks_tree, (avltree_key_t) id);
     
    265257/** Get accounting data of given task.
    266258 *
    267  * Note that task lock of 't' must be already held and
    268  * interrupts must be already disabled.
    269  *
    270  * @param t Pointer to thread.
    271  *
     259 * Note that task lock of 't' must be already held and interrupts must be
     260 * already disabled.
     261 *
     262 * @param t             Pointer to thread.
     263 *
     264 * @return              Number of cycles used by the task and all its threads
     265 *                      so far.
    272266 */
    273267uint64_t task_get_accounting(task_t *t)
     
    301295 * It signals all the task's threads to bail it out.
    302296 *
    303  * @param id ID of the task to be killed.
    304  *
    305  * @return 0 on success or an error code from errno.h
     297 * @param id            ID of the task to be killed.
     298 *
     299 * @return              Zero on success or an error code from errno.h.
    306300 */
    307301int task_kill(task_id_t id)
     
    324318       
    325319        /*
    326          * Interrupt all threads except ktaskclnp.
     320         * Interrupt all threads.
    327321         */
    328322        spinlock_lock(&ta->lock);
Note: See TracChangeset for help on using the changeset viewer.