Quality RTOS & Embedded Software

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


Poll binary mutex

Posted by Jonas Poulsen on November 5, 2010
The documentation says that is possible to poll the state of a semaphore: "A block time of zero can be used to poll the semaphore" in the xSemaphoreTake section.
I have a hard time making this work.
Polling a semaphore should not change it in any way, or am I confused by the idea of "polling" and "peeking"?

I can see in semphr.h that the xSemaphore cannot set the "just peeking" boolean to true.

#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueGenericReceive( ( xQueueHandle ) xSemaphore, NULL, xBlockTime, pdFALSE )

Please enlighten me...

Jonas, DK

RE: Poll binary mutex

Posted by Dave on November 5, 2010
Polling the semaphore will change its state if the semaphore is available, yes you are confused between polling and peeking.

RE: Poll binary mutex

Posted by Jonas Poulsen on November 5, 2010
Thank you for a quick reply :-)
BR, Jonas

[ 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