threadx
threadx copied to clipboard
Fix the issue of byte pool alloc fail when compile with -O3 optimization
https://github.com/eclipse-threadx/threadx/issues/334
PR checklist
- [x] Updated function header with a short description and version number
- [x] Added test case for bug fix or new feature
- [x] Validated on real hardware
It seems that the root-cause for this issue is a missing memory-clobber/compiler-barrier in the TX_DISABLE and TX_RESTORE macros (https://github.com/eclipse-threadx/threadx/issues/334#issuecomment-2068839866). I would suggest fixing this issue in the cpu-specific ports instead. There might be other places in the code with possible issues because of this.