From ae1eb6bb67904266d7378111fe70708855bc5fed Mon Sep 17 00:00:00 2001 From: caochao Date: Thu, 17 Feb 2022 10:58:56 +0800 Subject: [PATCH] fixed 66ea037 from https://gitee.com/caochao123/distributedschedule_samgr_lite/pulls/52 modify queue_pop race condition Signed-off-by: caochao Change-Id: Ib252acd48550d5873a2eb58a8743296b3532ba64 --- samgr/adapter/posix/queue_adapter.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/samgr/adapter/posix/queue_adapter.c b/samgr/adapter/posix/queue_adapter.c index da7f031..43416ca 100644 --- a/samgr/adapter/posix/queue_adapter.c +++ b/samgr/adapter/posix/queue_adapter.c @@ -66,10 +66,6 @@ int QUEUE_Pop(MQueueId queueId, void *element, uint8 *pri, int timeout) LockFreeBlockQueue *queue = (LockFreeBlockQueue *)queueId; pthread_mutex_lock(&queue->rMutex); - if (LFQUE_Pop(queue->queue, element, pri) == EC_SUCCESS) { - return EC_SUCCESS; - } - while (LFQUE_Pop(queue->queue, element, pri) != EC_SUCCESS) { pthread_cond_wait(&queue->cond, &queue->rMutex); } -- Gitee