FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2010 Threads]
I am not sure if I am correct, but a Mutex should be just that - Mutual Exclusion. If I take a mutex then no other call for that same mutex should succeed until I give the mutex back. This does not work with existing mutex implementation, as the mutex is implemented as a recursive semaphore. I have a mutex to protect the use of a serial port that is used by more than one task.
The messages that are sent on that port are mixed segments of messages from the multiple tasks.
Does anyone have a fix for this ? If not I will fix this and post the fix.
“If I take a mutex then no other call for that same mutex should succeed until I give the mutex back.”
Agreed.
“This does not work with existing mutex implementation”
? I think it does. The three mutex tasks that are implemented in the standard demo GenQTest.c file test the behaviour. Do you have a test case where it does not work as intended?
“as the mutex is implemented as a recursive semaphore”
? No it isn't.....a mutex is in effect a binary semaphore with the added functionality of priority inheritance - created using the xSemaphoreCreateMutex() API function. The recursive mutex implementation is quite separate, recursive mutexes are created using the xSemaphoreCreateRecursiveMutex() API function. A task cannot take a recursive mutex if it is held by another task, and cannot give one back unless it is already the mutex holder.
“Does anyone have a fix for this ? If not I will fix this and post the fix”
I'm not convinced there is a problem, so please demonstrate the problem and get agreement that it exists before trying to fix it. If there is a problem then posting a fix would be appreciated, although the bug tracker might be a better place to post it.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.