diff options
| author | thewon86 <[email protected]> | 2022-01-24 16:52:26 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-01-25 13:58:33 +0800 |
| commit | 4db9cfbebe6d66f31d3a851fde82fd20318bfd05 (patch) | |
| tree | eb96cdfb51be75062845a0245d50f85b8b24a4e2 /components/drivers/ipc/waitqueue.c | |
| parent | 3e59cfd70e5bfd9c95ac98a096432b1e9e2d185e (diff) | |
return thread error when resumed by signal
Diffstat (limited to 'components/drivers/ipc/waitqueue.c')
| -rw-r--r-- | components/drivers/ipc/waitqueue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/drivers/ipc/waitqueue.c b/components/drivers/ipc/waitqueue.c index 4c6bb7e97f..6a26604617 100644 --- a/components/drivers/ipc/waitqueue.c +++ b/components/drivers/ipc/waitqueue.c @@ -7,6 +7,7 @@ * Date Author Notes * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon * to blocked thread. + * 2022-01-24 THEWON let rt_wqueue_wait return thread->error when using signal */ #include <stdint.h> @@ -141,6 +142,10 @@ int rt_wqueue_wait(rt_wqueue_t *queue, int condition, int msec) rt_list_init(&__wait.list); level = rt_hw_interrupt_disable(); + + /* reset thread error */ + tid->error = RT_EOK; + if (queue->flag == RT_WQ_FLAG_WAKEUP) { /* already wakeup */ @@ -171,5 +176,5 @@ __exit_wakeup: rt_wqueue_remove(&__wait); - return 0; + return tid->error; } |
