[kernel] add assert to mempool object

This commit is contained in:
liang yongxiang 2018-07-11 11:47:15 +08:00
parent 5213fd0e95
commit ade8822352
1 changed files with 4 additions and 0 deletions

View File

@ -150,6 +150,8 @@ rt_err_t rt_mp_detach(struct rt_mempool *mp)
/* parameter check */
RT_ASSERT(mp != RT_NULL);
RT_ASSERT(rt_object_get_type(&mp->parent) == RT_Object_Class_MemPool);
RT_ASSERT(rt_object_is_systemobject(&mp->parent));
/* wake up all suspended threads */
while (!rt_list_isempty(&(mp->suspend_thread)))
@ -266,6 +268,8 @@ rt_err_t rt_mp_delete(rt_mp_t mp)
/* parameter check */
RT_ASSERT(mp != RT_NULL);
RT_ASSERT(rt_object_get_type(&mp->parent) == RT_Object_Class_MemPool);
RT_ASSERT(rt_object_is_systemobject(&mp->parent) == RT_FALSE);
/* wake up all suspended threads */
while (!rt_list_isempty(&(mp->suspend_thread)))