From 433f3aeb36792bbcfb157fdb41307a381a59431e Mon Sep 17 00:00:00 2001 From: wangxiangyang <491666853@qq.com> Date: Tue, 6 Sep 2022 21:18:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?pthread=5Fmutex=5Flock=E7=AD=89=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E9=9C=80=E8=A6=81=E6=98=BE=E5=BC=8F=E4=B8=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=BF=94=E5=9B=9E=E5=80=BC=20Signed-off-by:=20wangxia?= =?UTF-8?q?ngyang=20<491666853@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/datatransmitmgr/dev_slinfo_list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/datatransmitmgr/dev_slinfo_list.c b/frameworks/datatransmitmgr/dev_slinfo_list.c index 42c644c..1a154f6 100644 --- a/frameworks/datatransmitmgr/dev_slinfo_list.c +++ b/frameworks/datatransmitmgr/dev_slinfo_list.c @@ -47,7 +47,7 @@ static void UpdateListNode(struct DATASLListParams *newListNode, int32_t PushListNode(struct DATASLListParams *list, struct DATASLCallbackParams *callbackParams) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *newList = (struct DATASLListParams*)malloc(sizeof(struct DATASLListParams)); if (newList == NULL) { pthread_mutex_unlock(&gMutex); @@ -78,7 +78,7 @@ void RemoveListNode(struct DATASLListParams *list, struct DATASLCallbackParams } pList = pList->next; } - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); } void ClearList(struct DATASLListParams *list) -- Gitee From 328f3001fefe79c46e4b8014cc06f6148e63ad40 Mon Sep 17 00:00:00 2001 From: wangxiangyang <491666853@qq.com> Date: Mon, 19 Sep 2022 11:21:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?pthread=5Fmutex=5Flock=E7=AD=89=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=BF=94=E5=9B=9E=E5=80=BC=20Signed-off-by:=20wangxia?= =?UTF-8?q?ngyang=20<491666853@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/datatransmitmgr/dev_slinfo_list.c | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/frameworks/datatransmitmgr/dev_slinfo_list.c b/frameworks/datatransmitmgr/dev_slinfo_list.c index 1a154f6..f8da93e 100644 --- a/frameworks/datatransmitmgr/dev_slinfo_list.c +++ b/frameworks/datatransmitmgr/dev_slinfo_list.c @@ -23,16 +23,16 @@ pthread_mutex_t gMutex; struct DATASLListParams* InitList(void) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *list = (struct DATASLListParams *)malloc(sizeof(struct DATASLListParams)); if (list == NULL) { - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return NULL; } list->next = list; list->prev = list; list->callbackParams = NULL; - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return list; } @@ -50,19 +50,19 @@ int32_t PushListNode(struct DATASLListParams *list, struct DATASLCallbackParams (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *newList = (struct DATASLListParams*)malloc(sizeof(struct DATASLListParams)); if (newList == NULL) { - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return DEVSL_ERR_OUT_OF_MEMORY; } UpdateListNode(newList, list->prev, list); newList->callbackParams = callbackParams; - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return DEVSL_SUCCESS; } void RemoveListNode(struct DATASLListParams *list, struct DATASLCallbackParams *callbackParams) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *pList = list->next; while (pList != NULL && pList != list) { if (CompareUdid(&(pList->callbackParams->queryParams), &(callbackParams->queryParams)) == DEVSL_SUCCESS) { @@ -83,9 +83,9 @@ void RemoveListNode(struct DATASLListParams *list, struct DATASLCallbackParams void ClearList(struct DATASLListParams *list) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); if (list == NULL) { - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return; } struct DATASLListParams *pList = list->next; @@ -103,34 +103,34 @@ void ClearList(struct DATASLListParams *list) free(list->callbackParams); } free(list); - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); } int32_t GetListLength(struct DATASLListParams *list) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *pList = list->next; int32_t listLength = 0; while (pList != NULL && pList != list) { listLength++; pList = pList->next; } - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return listLength; } int32_t FindListNode(struct DATASLListParams *list, struct DATASLCallbackParams *callbackParams) { - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *pList = list->next; while (pList != NULL && pList != list) { if (CompareUdid(&(pList->callbackParams->queryParams), &(callbackParams->queryParams)) == DEVSL_SUCCESS) { - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return DEVSL_SUCCESS; } pList = pList->next; } - pthread_mutex_unlock(&gMutex); + (void) pthread_mutex_unlock(&gMutex); return DEVSL_ERROR; } @@ -139,7 +139,7 @@ void LookupCallback(struct DATASLListParams *list, DEVSLQueryParams *queryParams struct DATASLCallbackParams tmpCallbackParams; (void)memset_s(&tmpCallbackParams, sizeof(struct DATASLCallbackParams), 0, sizeof(struct DATASLCallbackParams)); int32_t ret = DEVSL_ERROR; - pthread_mutex_lock(&gMutex); + (void)pthread_mutex_lock(&gMutex); struct DATASLListParams *tmpCallback = list->next; while (tmpCallback != NULL && tmpCallback != list) { struct DATASLListParams *nextCallback = tmpCallback->next; @@ -160,7 +160,7 @@ void LookupCallback(struct DATASLListParams *list, DEVSLQueryParams *queryParams } tmpCallback = nextCallback; } - pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); if (ret == DEVSL_SUCCESS) { tmpCallbackParams.callback(&(tmpCallbackParams.queryParams), result, levelInfo); } -- Gitee From 8fa2869be4396d695e9bdc132b7d53596f3f5948 Mon Sep 17 00:00:00 2001 From: wangxiangyang <491666853@qq.com> Date: Wed, 21 Sep 2022 11:25:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?pthread=5Fmutex=5Flock=E7=AD=89=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=BF=94=E5=9B=9E=E5=80=BC=20Signed-off-by:=20wangxia?= =?UTF-8?q?ngyang=20<491666853@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/datatransmitmgr/dev_slinfo_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/datatransmitmgr/dev_slinfo_list.c b/frameworks/datatransmitmgr/dev_slinfo_list.c index f8da93e..5eebc95 100644 --- a/frameworks/datatransmitmgr/dev_slinfo_list.c +++ b/frameworks/datatransmitmgr/dev_slinfo_list.c @@ -130,7 +130,7 @@ int32_t FindListNode(struct DATASLListParams *list, struct DATASLCallbackParams } pList = pList->next; } - (void) pthread_mutex_unlock(&gMutex); + (void)pthread_mutex_unlock(&gMutex); return DEVSL_ERROR; } -- Gitee