Skip to content
Snippets Groups Projects
Commit 168fe137 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2
Browse files

tls: remove unneeded atomic load


TlsSession state holder 'state_' is loaded twice
when we check for its modification in the TlsSession
state machine code.
std::atomic_compare_exchange_strong returns false when
'state_' is not equals to 'old_state' and in this case
'old_state' is changed for the current value of 'state_'.
So reload it right after the returns is not efficient
and may also have an unexpected corner case.

This patch re-uses the value of 'old_state' for next
processing.

Change-Id: Ia29abc0f5834caabf12f1ae528ff11b132bd603c
Reviewed-by: default avatarStepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
parent c4d7748e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment