- On v11.1 SMP, pvPortMalloc() should not be called in critical secion.
vTaskSuspenAll() would trigger assert if in criticalsection.
- The pthread_cond APIs are not ISR safe. Use vTaskSuspendAll() to prevent
race condition is enough.
Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Co-authored-by: wangfei_chen <wangfei_chen@realsil.com.cn>
* timer: prevent infinite loop on one-shot timer start
One-shot timers that expire after a single tick could immediately
transition to a dormant state, despite xTimerCommandSent being pdTRUE.
This situation resulted in a potential deadlock due to an infinite
loop in the timer activation process.
Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
* Code review suggestions
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------
Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
If configENABLE_BACKWARD_COMPATIBILITY is defined, then xTimerHandle is
defined to TimerHandle_t which would result in conflict.
Fixes#35.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Update the pthread_cond_t implementation to utilize Task Notifications.
In the existing implementation, if multiple threads of different
priority are blocked on the same condition, a higher priority thread, in
most cases, will unblock multiple times due to taking the underlying
semaphore multiple times instead of just once. Switching to Task
notifications guarantees that all tasks are equally notified and
unblocked.
pthread_cond_signal has also been updated to conform to the POSIX
specification in that it will unblock the highest priority task waiting
on the condition.
Resolves#8
We do have other errors when C99 is disabled, namely the struct initialization and type casting.
I'm not fixing those here, since:
- struct init is consistent within this lib.
- type casting is needed in this design, to hide FreeRTOS symbols.