Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move xSemaphoreGive out of configASSERT (IDFGH-7988) #9497

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

tgotic
Copy link
Contributor

@tgotic tgotic commented Aug 4, 2022

xSemaphoreGive won't be executed in configASSERT and semaphore will stay locked if NDEBUG (idf v5) or CONFIG_FREERTOS_ASSERT_DISABLE (idf v3, v4) are defined.

xSemaphoreGive won't be executed in configASSERT and semaphore will stay locked if NDEBUG (idf v5) or CONFIG_FREERTOS_ASSERT_DISABLE (idf v3, v4) are defined.
@espressif-bot espressif-bot added the Status: Opened Issue is new label Aug 4, 2022
@github-actions github-actions bot changed the title Move xSemaphoreGive out of configASSERT Move xSemaphoreGive out of configASSERT (IDFGH-7988) Aug 4, 2022
@igrr igrr added PR-Sync-Merge Pull request sync as merge commit and removed PR-Sync-Merge Pull request sync as merge commit labels Aug 4, 2022
Copy link
Member

@igrr igrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for noticing the bug and submitting the fix! Have left just one request about making the code more readable.

@@ -1358,7 +1358,8 @@ BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHan
xReturn = xQueueAddToSet(rbGET_RX_SEM_HANDLE(pxRingbuffer), xQueueSet);
if (xHoldSemaphore == pdTRUE) {
//Return semaphore if temporarily held
configASSERT(xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer)) == pdTRUE);
xHoldSemaphore = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you consider changing this assignment to some new variable? Repurposing the xHoldSemaphore variable for the return code looks a bit odd here.

(same in the case below)

@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

@Dazza0
Copy link
Contributor

Dazza0 commented Aug 11, 2022

LGTM

@Dazza0
Copy link
Contributor

Dazza0 commented Aug 11, 2022

sha=4837ba9b84aa00ff230e729f15728b93d327b352

@Dazza0 Dazza0 added the PR-Sync-Merge Pull request sync as merge commit label Aug 11, 2022
@Dazza0 Dazza0 self-requested a review August 11, 2022 16:04
@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Resolution: NA Issue resolution is unavailable labels Aug 12, 2022
@espressif-bot espressif-bot merged commit c0f5e12 into espressif:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Merge Pull request sync as merge commit Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants