resource-manager: Introduce resource instance type
To clearly partition the way how resource works, added instance_type
to resource, INSTANCE_TYPE_NORMAL and INSTANCE_TYPE_MONITOR. Resource
instance of each type can be created by the below functions:
- INSTANCE_TYPE_NORMAL: syscommon_resman_create_resource()
- INSTANCE_TYPE_MONITOR: syscommon_resman_monitor_create_resource()
Instance type of NORMAL sets all interest bits by default. Therefore,
it doesn't need to set interest bit additionally. On the other hand,
instance type of MONITOR clears all interest bits by default. Therefore,
it should set bit manually in which a monitor interest before it starts
monitoring.
In addition, instance type of NORMAL always invoke its attribute
getter for every access to attribute value. That is, it always fetches
the latest value. On the other hand, instance type of MONITOR fetches
attribute value on a specific time that must have been synchronized by
syscommon_resman_monitor_update_resource_attrs().
Change-Id: I39b2089a21d5b5d7b59704a7835e2646939a20c2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>