diff options
| author | bernard.xiong <[email protected]> | 2009-12-16 08:28:01 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2009-12-16 08:28:01 +0000 |
| commit | fe92b1daed45e7c318d172159df880fed7085db7 (patch) | |
| tree | a47cbed59a07cff4203094796854b6e36365e4ef /src/ipc.c | |
| parent | e1a2102e518c766ade2feb9b3b635cbe10764232 (diff) | |
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
Diffstat (limited to 'src/ipc.c')
| -rw-r--r-- | src/ipc.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 <rtthread.h> @@ -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; } |
