From fe92b1daed45e7c318d172159df880fed7085db7 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Wed, 16 Dec 2009 08:28:01 +0000 Subject: [PATCH] fix the rt_ipc_object_suspend issue when IPC flag is RT_IPC_FLAG_PRIO git-svn-id: https://rt-thread.googlecode.com/svn/trunk@201 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/ipc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ipc.c b/src/ipc.c index 6e2974322..b073e9f0f 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -28,6 +28,8 @@ * 2009-10-10 Bernard change semaphore and mutex value to unsigned value * 2009-10-25 Bernard change the mb/mq receive timeout to 0 if the * re-calculated delta tick is a negative number. + * 2009-12-16 Bernard fix the rt_ipc_object_suspend issue when IPC flag + * is RT_IPC_FLAG_PRIO */ #include @@ -98,10 +100,13 @@ rt_inline rt_err_t rt_ipc_object_suspend(struct rt_ipc_object *ipc, struct rt_th sthread = rt_list_entry(n, struct rt_thread, tlist); /* find out */ - if (thread->current_priority < sthread->current_priority) break; + if (thread->current_priority < sthread->current_priority) + { + /* insert this thread before the sthread */ + rt_list_insert_before(&(sthread->tlist), &(thread->tlist)); + break; + } } - - rt_list_insert_before(&(ipc->suspend_thread), &(thread->tlist)); } break; } -- GitLab