resource-manager: Introduce resource instance type 46/288646/10
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 21 Feb 2023 01:41:58 +0000 (10:41 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 8 Mar 2023 01:03:35 +0000 (10:03 +0900)
commitf1a21857ca4275d218cf8bbb7ef9e3bc3780e5eb
tree2fbe4f3721a2e0f71b5942e8a54cfb5dfb574a37
parentb05b507adde3ea5433b444afa9449508741250b2
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>
src/resource-manager/resource-manager.c
src/resource-manager/resource-manager.h