semTake() with a negative timeout? - VxWorks

This is a discussion on semTake() with a negative timeout? - VxWorks ; The timeout parameter to semTake() is defined as an int. WAIT_FOREVER is defined as -1. What happens if you pass a negative value (other than WAIT_FOREVER) to semTake?...

+ Reply to Thread
Results 1 to 2 of 2

Thread: semTake() with a negative timeout?

  1. semTake() with a negative timeout?


    The timeout parameter to semTake() is defined as an int. WAIT_FOREVER
    is defined as -1. What happens if you pass a negative value (other than
    WAIT_FOREVER) to semTake?

  2. Re: semTake() with a negative timeout?

    red floyd wrote:

    >The timeout parameter to semTake() is defined as an int. WAIT_FOREVER
    >is defined as -1. What happens if you pass a negative value (other than
    >WAIT_FOREVER) to semTake?


    From the v5.5 man page for semTake():

    RETURNS OK, or ERROR if the semaphore ID is invalid or the task timed out.

    I can't prove it but I expect your scenario returns error
    after first assigning the value True to the global variable
    smackYaOneForCrackingSoWiseAlready.

    ;-)

    --
    ================================================== ======================
    Michael Kesti | "And like, one and one don't make
    | two, one and one make one."
    mrkesti at hotmail dot com | - The Who, Bargain

+ Reply to Thread