[kernel] add assert to mempool object
This commit is contained in:
parent
5213fd0e95
commit
ade8822352
|
@ -150,6 +150,8 @@ rt_err_t rt_mp_detach(struct rt_mempool *mp)
|
||||||
|
|
||||||
/* parameter check */
|
/* parameter check */
|
||||||
RT_ASSERT(mp != RT_NULL);
|
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 */
|
/* wake up all suspended threads */
|
||||||
while (!rt_list_isempty(&(mp->suspend_thread)))
|
while (!rt_list_isempty(&(mp->suspend_thread)))
|
||||||
|
@ -266,6 +268,8 @@ rt_err_t rt_mp_delete(rt_mp_t mp)
|
||||||
|
|
||||||
/* parameter check */
|
/* parameter check */
|
||||||
RT_ASSERT(mp != RT_NULL);
|
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 */
|
/* wake up all suspended threads */
|
||||||
while (!rt_list_isempty(&(mp->suspend_thread)))
|
while (!rt_list_isempty(&(mp->suspend_thread)))
|
||||||
|
|
Loading…
Reference in New Issue