summaryrefslogtreecommitdiff
path: root/osal/usb_osal_threadx.c
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-06-03 17:31:31 +0800
committersakumisu <[email protected]>2025-06-03 22:43:35 +0800
commitbff8a632a926cf976c3bbb18097f8a70d7cd9b93 (patch)
treed2219f3e1674f78b8cc69bae6aa18df06cac8be5 /osal/usb_osal_threadx.c
parenta8bf2687bde6ff5eb8e5b501226cb21945a7f8df (diff)
feat(class): add usb_osal_thread_schedule_other to allow the applications which use the struct usbh_xxx to exit properly before free struct usbh_xxx
Signed-off-by: sakumisu <[email protected]>
Diffstat (limited to 'osal/usb_osal_threadx.c')
-rw-r--r--osal/usb_osal_threadx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/osal/usb_osal_threadx.c b/osal/usb_osal_threadx.c
index 5d2e13c7..62dd3b84 100644
--- a/osal/usb_osal_threadx.c
+++ b/osal/usb_osal_threadx.c
@@ -69,6 +69,18 @@ void usb_osal_thread_delete(usb_osal_thread_t thread)
tx_byte_release(thread);
}
+void usb_osal_thread_schedule_other(void)
+{
+ TX_THREAD *current_thread = tx_thread_identify();
+ const UINT old_priority = current_thread->tx_thread_priority;
+
+ tx_thread_priority_change(current_thread, TX_MAX_PRIORITIES - 1, &old_priority);
+
+ tx_thread_relinquish();
+
+ tx_thread_priority_change(current_thread, old_priority, &old_priority);
+}
+
usb_osal_sem_t usb_osal_sem_create(uint32_t initial_count)
{
TX_SEMAPHORE *sem_ptr = TX_NULL;