Quality RTOS & Embedded Software

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


Nonblocking mutex take from ISR

Posted by Kevin on November 14, 2012
I understand that ISRs cannot block waiting on mutexes. However, I would like to take a mutex in an ISR only if it is available, and not otherwise. This is equivalent to pthread_mutex_trylock in posix threads. Is it safe to call xSemaphoreTake with a timeout of 0 from an ISR in all cases? I'm not sure why this wouldn't work, but the API reference says it doesn't. Is there another way to handle this? Or is this operation unsupported by FreeRTOS?

Thank you,

RE: Nonblocking mutex take from ISR

Posted by MEdwards on November 14, 2012
FreeRTOS V7.2.0 (it is not on 7.3.0) added an xSemaphoreTakeFromISR() function. Use with caution on a mutex type sempahore as I don't know the implications on priority inheritance. It might be ok, I don't know. Richard?

[ 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