From 4db9cfbebe6d66f31d3a851fde82fd20318bfd05 Mon Sep 17 00:00:00 2001 From: thewon86 Date: Mon, 24 Jan 2022 16:52:26 +0800 Subject: return thread error when resumed by signal --- components/drivers/ipc/waitqueue.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'components') 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 @@ -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; } -- cgit v1.3.1