Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 9dcf472 in mainline


Ignore:
Timestamp:
2019-10-02T10:27:50Z (13 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
5667dca
Parents:
2443ad8
git-author:
Jiri Svoboda <jiri@…> (2019-10-01 18:27:34)
git-committer:
Jiri Svoboda <jiri@…> (2019-10-02 10:27:50)
Message:

Trace should not wait for spawned task by ID

It can just use a task_wait_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/trace.c

    r2443ad8 r9dcf472  
    8989
    9090static task_id_t task_id;
     91static task_wait_t task_w;
    9192static bool task_wait_for;
    9293
     
    113114        errno_t rc;
    114115
    115         rc = task_spawnv_debug(&task_id, NULL, cmd_path,
     116        rc = task_spawnv_debug(&task_id, &task_w, cmd_path,
    116117            (const char *const *)cmd_args, &sess);
    117118
     
    135136        errno_t rc;
    136137        bool debug_started = false;
     138        bool wait_set_up = false;
    137139
    138140        if (sess == NULL) {
     
    151153
    152154                debug_started = true;
     155
     156                rc = task_setup_wait(task_id, &task_w);
     157                if (rc != EOK) {
     158                        printf("Error setting up wait for task termination.\n");
     159                        goto error;
     160                }
     161
     162                wait_set_up = true;
    153163        }
    154164
     
    161171        return EOK;
    162172error:
     173        if (wait_set_up)
     174                task_cancel_wait(&task_w);
    163175        if (debug_started)
    164176                udebug_end(sess);
     
    807819                printf("Waiting for task to exit.\n");
    808820
    809                 rc = task_wait_task_id(task_id, &texit, &retval);
     821                rc = task_wait(&task_w, &texit, &retval);
    810822                if (rc != EOK) {
    811823                        printf("Failed waiting for task.\n");
Note: See TracChangeset for help on using the changeset viewer.