diff options
| author | sakimisu <[email protected]> | 2023-07-12 21:48:18 +0800 |
|---|---|---|
| committer | sakimisu <[email protected]> | 2023-07-12 21:48:18 +0800 |
| commit | 47c0255cdc01bbad8080b32912893c8e1b912ea7 (patch) | |
| tree | 721aaf03261ee3af1273caefab8c1fec46321469 | |
| parent | d53e8a2adfaa0ff6a058f47e65d7382ce35630c9 (diff) | |
fix rt-thread once thread delete
| -rw-r--r-- | class/hub/usbh_hub.c | 2 | ||||
| -rw-r--r-- | osal/usb_osal_rtthread.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c index 1a100d7c..2f40da10 100644 --- a/class/hub/usbh_hub.c +++ b/class/hub/usbh_hub.c @@ -449,7 +449,7 @@ static void usbh_hubport_enumerate_thread(void *argument) usbh_hubport_release(child); USB_LOG_ERR("Port %u enumerate fail\r\n", child->port); } - usb_osal_thread_delete(child->thread); + usb_osal_thread_delete(NULL); } static void usbh_hub_events(struct usbh_hub *hub) diff --git a/osal/usb_osal_rtthread.c b/osal/usb_osal_rtthread.c index 1882830d..a0f7563c 100644 --- a/osal/usb_osal_rtthread.c +++ b/osal/usb_osal_rtthread.c @@ -18,6 +18,10 @@ usb_osal_thread_t usb_osal_thread_create(const char *name, uint32_t stack_size, void usb_osal_thread_delete(usb_osal_thread_t thread) { + if (thread == NULL) { + return; + } + rt_thread_delete(thread); } |
