Closed akashjjohnWs closed 10 months ago
ThreadX for Linux is for simulation purpose. Not all native Linux resources are managed by ThreadX. The glibc lock is out of the management of ThreadX. To avoid such deadlock, please try to create a ThreadX mutex to synchronize the usage of printf. Whenever printf is invoked, protect it with ThreadX mutex.
Describe the bug Deadlock when running threadx application with linux port. A lower priority thread gets suspended while holding an internal glibc lock. A higher priority thread gets stuck waiting for this lock which it never gets. Seeing this in time functions, printf functions and all.
To Reproduce The issue is very difficult to reproduce. Running a multi-thread threadx application with threads with variying priorities, this issue would pop up. Since the issue is related to the scheduling timing, it might take a long time for this issue to pop up. Steps to reproduce the behavior:
Expected behavior The lower priority thread should be able to complete its operation and release the lock.