فهرست منبع

[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.
Grissiom 11 سال پیش
والد
کامیت
a78e42a7c8
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/mempool.c

+ 2 - 0
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));