From 3bc869233a655dfcbd3c5aafeb71adddb1a270bc Mon Sep 17 00:00:00 2001 From: liuchungang Date: Tue, 14 May 2024 15:41:08 +0800 Subject: [PATCH 1/4] add error code Signed-off-by: liuchungang --- resourceschedule/qos_manager/c/qos.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index c92ab5b86..53abc9631 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -79,6 +79,11 @@ typedef enum QoS_Level { QOS_USER_INTERACTIVE, } QoS_Level; +typedef enum { + ffrt_error = -1, + ffrt_success = 0, +} OH_QoS_ErrCode; + /** * @brief Set the QoS level of the current thread. * -- Gitee From 78f051f78fc8918289076ea939e71a0810b09214 Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 20 May 2024 06:32:12 +0000 Subject: [PATCH 2/4] add qos errcode Signed-off-by: Ethan --- resourceschedule/qos_manager/c/qos.h | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index 53abc9631..520c1910e 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -79,16 +79,31 @@ typedef enum QoS_Level { QOS_USER_INTERACTIVE, } QoS_Level; +/** + *@brief Enum of qos error code. + * + *@since@12 +*/ typedef enum { - ffrt_error = -1, - ffrt_success = 0, -} OH_QoS_ErrCode; + /** @error Operation sucess*/ + QOS_SUCCESS = 0, + /** @error Operation failde*/ + QOS_FAILURE = -1, + /** @error Invalid parameter */ + QOS_INVALID_PARAMETR = -2, + /** @error Operation not allowed*/ + QOS_NOT_ALLOWED = -3, + /** @error Operation not supported*/ + QOS_NO_SUPPORT = -4 +} QoS_ErrCode; /** * @brief Set the QoS level of the current thread. * * @param level Indicates the level to set. Specific level can be referenced {@link QoS_Level}. - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. + * {@link QOS_INVALID_PARAMETR} level is out of range. * @see QoS_Level * @since 12 */ @@ -97,7 +112,8 @@ int OH_QoS_SetThreadQoS(QoS_Level level); /** * @brief Cancel the QoS level of the current thread. * - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. * @see QoS_Level * @since 12 */ @@ -108,7 +124,9 @@ int OH_QoS_ResetThreadQoS(); * * @param level This parameter is the output parameter, * and the QoS level of the thread as a {@link QoS_Level} is written to this variable. - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. + * {@link QOS_INVALID_PARAMETR} level is null. * @see QoS_Level * @since 12 */ -- Gitee From 1a37f5d32efcda4dbe967b24c12f32ac8ec2c0cf Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 20 May 2024 07:01:09 +0000 Subject: [PATCH 3/4] add qos errcode Signed-off-by: Ethan --- resourceschedule/qos_manager/c/qos.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index 520c1910e..40ea0dd1f 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -82,9 +82,9 @@ typedef enum QoS_Level { /** *@brief Enum of qos error code. * - *@since@12 + *@since@ 12 */ -typedef enum { +typedef enum QoS_ErrCode { /** @error Operation sucess*/ QOS_SUCCESS = 0, /** @error Operation failde*/ -- Gitee From bedfca5787b2bb4ade97ac7dac8abe99f5748b42 Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 20 May 2024 07:30:34 +0000 Subject: [PATCH 4/4] add qos errcode Signed-off-by: Ethan --- resourceschedule/qos_manager/c/qos.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index 40ea0dd1f..bdcc00b29 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -82,7 +82,7 @@ typedef enum QoS_Level { /** *@brief Enum of qos error code. * - *@since@ 12 + *@since 12 */ typedef enum QoS_ErrCode { /** @error Operation sucess*/ @@ -90,7 +90,7 @@ typedef enum QoS_ErrCode { /** @error Operation failde*/ QOS_FAILURE = -1, /** @error Invalid parameter */ - QOS_INVALID_PARAMETR = -2, + QOS_INVALID_PARAMETER = -2, /** @error Operation not allowed*/ QOS_NOT_ALLOWED = -3, /** @error Operation not supported*/ -- Gitee