diff options
| author | [email protected] <[email protected]> | 2011-06-04 13:30:43 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-06-04 13:30:43 +0000 |
| commit | 24c5c982401f65f8ef8eecbb7ef94ef83042b32f (patch) | |
| tree | b3515248529c7b44872d5d8910d4617b5bbf92a7 | |
| parent | ae4fa4fcbe8b0d51b8fa77231ba2bc239624dbeb (diff) | |
move the setting next pointer to NULL out off interrupt disable.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1450 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | src/ipc.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1713,6 +1713,8 @@ rt_err_t rt_mq_send (rt_mq_t mq, void* buffer, rt_size_t size) /* enable interrupt */ rt_hw_interrupt_enable(temp); + /* the msg is the new tailer of list, the next shall be NULL */ + msg->next = RT_NULL; /* copy buffer */ rt_memcpy(msg + 1, buffer, size); @@ -1724,8 +1726,6 @@ rt_err_t rt_mq_send (rt_mq_t mq, void* buffer, rt_size_t size) /* if the tail exists, */ ((struct rt_mq_message*)mq->msg_queue_tail)->next = msg; } - /* the msg is the new tail of list, the next shall be NULL */ - msg->next = RT_NULL; /* set new tail */ mq->msg_queue_tail = msg; @@ -1820,7 +1820,6 @@ rt_err_t rt_mq_urgent(rt_mq_t mq, void* buffer, rt_size_t size) rt_hw_interrupt_enable(temp); rt_schedule(); - return RT_EOK; } |
