eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.8k stars 767 forks source link

Fix the issue of byte pool alloc fail when compile with -O3 optimization #367

Open yuhiping opened 4 months ago

yuhiping commented 4 months ago

https://github.com/eclipse-threadx/threadx/issues/334

PR checklist

freyc commented 2 months ago

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.