summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2014-04-16 10:47:30 +0800
committerGrissiom <[email protected]>2014-04-16 10:59:33 +0800
commita78e42a7c8b63ef099ef5a3c1c019c4aa227b5ca (patch)
treea96fbbc0d08166958a88154a11550750496680c6 /src
parent3b6198275b4ad6322d4841a136c34293bd1e642c (diff)
[mempool] reset the thread->error before suspending thread
Time out result and other errors is recorded in thread->error. Dirty error will screw up the error handling code after the thread has been wake up.
Diffstat (limited to 'src')
-rw-r--r--src/mempool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mempool.c b/src/mempool.c
index c9bcd7a45c..05904bfbc7 100644
--- a/src/mempool.c
+++ b/src/mempool.c
@@ -356,6 +356,8 @@ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time)
/* get current thread */
thread = rt_thread_self();
+ thread->error = RT_EOK;
+
/* need suspend thread */
rt_thread_suspend(thread);
rt_list_insert_after(&(mp->suspend_thread), &(thread->tlist));