- The system workqueue may preempt a self-deleting thread after the
release work is submitted. Waiting for the thread with k_thread_join()
before freeing its TCB and stack prevents use-after-free corruption.
- Also handle release work allocation failure before aborting the thread.
Signed-off-by: Zhihong Chen <[email protected]>
Replace nxsched_self() and nxsched_set_priority() with
standard POSIX sched_getparam() and sched_setparam() in
usb_osal_thread_schedule_other().
This improves portability and follows POSIX standards for
thread priority management.
Change-Id: I2e637268f77e200fbdee3e7713cba1b115976696
Signed-off-by: SunJ <[email protected]>
- Allocate only once at `usb_osal_thread_create`.
- Fixed a null pointer crash in `usb_osal_thread_delete`.
- Standardized the return value of `usb_osal_sem_give`.