diff options
| author | Bernard Xiong <[email protected]> | 2018-07-12 14:09:39 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-07-12 14:09:39 +0800 |
| commit | 5c420c0c6e23de57ba2f308ec3c99b8da19c8311 (patch) | |
| tree | 061a3e5bebe25de8152a878f35709ec40d8bea9d /src/mempool.c | |
| parent | 41f2f1829f3227b2d405feb75751ac5debfcc1e8 (diff) | |
| parent | 44712ba2cfd113374986f7a63d7c48ec34c4a8da (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'src/mempool.c')
| -rw-r--r-- | src/mempool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mempool.c b/src/mempool.c index 3f95279ed1..cd98e8c14e 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -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))) |
