Fix: Guard st22p_rx_get_frame block wait with pending flag - #1690
Open
awilczyns wants to merge 1 commit into
Open
Fix: Guard st22p_rx_get_frame block wait with pending flag#1690awilczyns wants to merge 1 commit into
awilczyns wants to merge 1 commit into
Conversation
Coverity CID 560632 (BAD_CHECK_OF_WAIT_COND): the block-mode wait in st22p_rx_get_frame used a bare if-guarded single mt_pthread_cond_timedwait_ns. A spurious wakeup, or a wake-then-lose-CAS race under contention, returned NULL immediately instead of waiting up to block_timeout_ns as documented for ST22P_RX_FLAG_BLOCK_GET. Adopt the block_wake_pending predicate-loop pattern already used by st20/30/40 pipeline RX and st22 pipeline TX. Signed-off-by: Wilczynski, Andrzej <andrzej.wilczynski@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverity CID 560632 (BAD_CHECK_OF_WAIT_COND): the block-mode wait in st22p_rx_get_frame used a bare if-guarded single
mt_pthread_cond_timedwait_ns. A spurious wakeup, or a wake-then-lose-CAS race under contention, returned NULL immediately instead of waiting up to block_timeout_ns as documented for ST22P_RX_FLAG_BLOCK_GET. Adopt the block_wake_pending predicate-loop pattern already used by st20/30/40 pipeline RX and st22 pipeline TX.