Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Changing the xTicksToWait in xQueueReceive

Posted by Thomas Johansen on January 19, 2012

I just wonder (I couldn't find the info elsewhere), what happens if the xTicksToWait in the xQueueReceive is changed while the function call is blocked?

If the xQueueReceive is called with portMAX_DELAY and that is changed to something else. Would the xQueueReceive return if that new timeout has elapsed or do I have to call xQueueReceive again to use this new timeout?


RE: Changing the xTicksToWait in xQueueReceive

Posted by Richard on January 19, 2012
You are looking at the implementation of an API function - which is fine if you are doing that out of curiosity or want to know how FreeRTOS works. If on the other hand you are just wanting to use FreeRTOS, then you only need to know the behaviour of the API function, and not how it implements that behavior.

If a task calls xQueueReceive() with a block time, then the time at which the task should unblock if there is no data to receive is calculated at the time xQueueReceive() is called - and that value cannot be changed after the function has been called. The manipulation of xTicksToWait in the function implementation ensures that behaviour is correct - it does not effect the time at which the task unblocks.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner