FreeRTOS / Lab-Project-FreeRTOS-POSIX

This repository contains FreeRTOS+POSIX source code, which could be consumed as a submodule.
MIT License
95 stars 60 forks source link

sem_timedwait always decrements semaphore value #26

Open fdgonthier opened 1 year ago

fdgonthier commented 1 year ago

On entering the sem_timedwait function the semaphore value is (correctly?) decremented but it is never reset to its original value when xSemaphoreTake returns a timeout. In my case, this means that in a loop where sem_timedwait is called with a timeout, the value of the semaphore keeps getting more negative.

A patch is forthcoming as I need this to work.

paulbartell commented 1 year ago

@fdgonthier : Did you ever get this working as expected? We would greatly appreciate a patch if so.