This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX51-Tiny: os_wait2(..) return question

If I call os_wait2(..) as listed in the example below, and if subsequently another task signals MyTask() AND it times out, what will the return value be? The manual states the return value will be a manifest constant identifying the event that restarted the task, but its not clear whether this is only one of the constants or can be a combination thereof.

void MyTask( void ) _task_ 0
{
    ret_val = os_wait2( K_SIG | K_TMO, 25 );

    // what will ret_val be if the task both
    // timed out AND was signaled ???
}

Parents
  • Well, as it turns out, I did resort to some experimentation. As in the original example above, I performed the os_wait2(..) specifying K_SIG | K_TMO for the event types, then I let another task a) delay long enough for the first task's timeout to expire, then b) I signaled it. ( I also swapped the order of a and b around as well).

    In both instances, upon return to the original task, its return type indicated SIG_EVENT. Thus, I conclude K_SIG takes priority.

    Now, is this "proof" that K_SIG takes priority? Only so far as the accuracy of the experiment. I would have a much greater feeling of confidence in this answer if examination of Tiny's task switch code verified the conclusion as well. That area of the source code, however, isn't too straight forward.

    Perhaps if one of Kiel's tech support personnel read this, they can confirm or deny what I found.

    Thanks to everyone for you help and suggestions.

    R. Wey

Reply
  • Well, as it turns out, I did resort to some experimentation. As in the original example above, I performed the os_wait2(..) specifying K_SIG | K_TMO for the event types, then I let another task a) delay long enough for the first task's timeout to expire, then b) I signaled it. ( I also swapped the order of a and b around as well).

    In both instances, upon return to the original task, its return type indicated SIG_EVENT. Thus, I conclude K_SIG takes priority.

    Now, is this "proof" that K_SIG takes priority? Only so far as the accuracy of the experiment. I would have a much greater feeling of confidence in this answer if examination of Tiny's task switch code verified the conclusion as well. That area of the source code, however, isn't too straight forward.

    Perhaps if one of Kiel's tech support personnel read this, they can confirm or deny what I found.

    Thanks to everyone for you help and suggestions.

    R. Wey

Children
No data