[Kernel] Add object re-initialization check.

This commit is contained in:
BernardXiong 2019-03-26 13:49:18 +00:00
parent b1a98ebe46
commit 50a97669cf
1 changed files with 3 additions and 0 deletions

View File

@ -251,6 +251,9 @@ void rt_object_init(struct rt_object *object,
/* initialize object's parameters */ /* initialize object's parameters */
/* check object type to avoid re-initialization */
RT_ASSERT(object->type != (type | RT_Object_Class_Static));
/* set object type to static */ /* set object type to static */
object->type = type | RT_Object_Class_Static; object->type = type | RT_Object_Class_Static;