GThread *dispatcher_thread;
} mm_resource_manager_s;
+static const char *res_state_str[MM_RESOURCE_MANAGER_RES_STATE_FOR_RELEASE + 1] = {
+ "FOR ACQUIRE",
+ "ACQUIRED",
+ "FOR RELEASE",
+};
+
static void __init_lib() __attribute__((constructor));
static void __deinit_lib() __attribute__((destructor));
static int __check_resource(mm_resource_manager_s *rm, mm_resource_manager_res_type_e type, mm_resource_manager_res_volume volume);
resource_id = resource->id;
MM_RM_HASH64(resource_id);
- MM_RM_INFO("Resource %p (%s) is marked for release in RM #%"PRIu64" (resource #%"PRIu64")",
- resource_h, _mm_resource_manager_get_res_str(resource->type), handle_id, resource_id);
-
MM_RM_RETVM_IF(handle_id != resource_id, MM_RESOURCE_MANAGER_ERROR_INVALID_PARAMETER,
"handle RM #%"PRIu64" is not resource RM #%"PRIu64, handle_id, resource_id);
+ MM_RM_INFO("[invoked : %d state : %s] Resource %p is marked for release in resource #%"PRIu64,
+ handle->release_cb.is_invoked, res_state_str[resource->state], resource_h, resource_id);
+
/* FIXME : We should consider resource lock's vulnerability because of using global variable of 'handles_lock' */
if (handle->release_cb.is_invoked) {
MM_RM_DEBUG("Resource %p (%s) release is executing in RM #%"PRIu64,
return MM_RESOURCE_MANAGER_ERROR_INVALID_OPERATION;
}
+ MM_RM_INFO("(%s) is marked for release in RM #%"PRIu64, _mm_resource_manager_get_res_str(resource->type), resource_id);
+
__mm_resources_lock(handle);
__mm_resource_handles_unlock();
__mm_resources_unlock(handle);
+ MM_RM_INFO("RM #%"PRIu64" is completed to mark", resource_id);
+
return MM_RESOURCE_MANAGER_ERROR_NONE;
}
return FALSE;
case MM_RESOURCE_MANAGER_RES_STATE_ACQUIRED:
resource->state = MM_RESOURCE_MANAGER_RES_STATE_FOR_RELEASE;
+ MM_RM_DEBUG("Resource %p is successfully marked", resource);
break;
case MM_RESOURCE_MANAGER_RES_STATE_FOR_RELEASE:
MM_RM_DEBUG("Resource %p is already marked", resource);