提交 ade88223 编写于 作者: L liang yongxiang

[kernel] add assert to mempool object

上级 5213fd0e
......@@ -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)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册