Quality RTOS & Embedded Software

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




Loading

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...

BR,
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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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