Quality RTOS & Embedded Software

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


Question on vTaskSuspend()

Posted by Paul Coleman on January 17, 2013
If I have a task waiting on a semaphore with a timeout of say 1 second and I call vTaskSuspend () on that task for more than 1 second what will happen? When the task resumes will the wait for semaphore have timed out or does the tick for that semaphore wait routine also get suspended when the task is suspended?
Thanks, Paul.

RE: Question on vTaskSuspend()

Posted by Neil on January 17, 2013
Sorry to Hijack your thread. For some reason, I am unable to post new threads and can only reply to old ones (hence the rudeness in replying to your post). The forum home page shows "Due to spam, anonymous posts are no longer permitted. Please register to post." but I am obviously registered with SourceForge or otherwse I wouldn't be able to reply.

Anyone know how I can post new threads?

RE: Question on vTaskSuspend()

Posted by Dave on January 17, 2013
I think this is what will happen.

Taskx enters the blocked state with a time out because a semaphore is not there. The unblock time is calculated.

Taskx is suspended.

When taskx is resumed it enteres the running state

When taskx next runs it attempts to get the semaphore again, if the semaphore is still not available the block time is re evaluated, then

...if block time remains the task will enter the Blocked state again until the block time expires or the semaphore is returned.


...if the block time has expired the semaphore take function exits returning pdFAIL

RE: Question on vTaskSuspend()

Posted by Neil on January 17, 2013
Sorry, I figured out how to post. 2 negative sigma IQ in acgtion.

[ 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