You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the check c.isHandshakeCompletedSuccessfully is not in the same critical section as c.setHandshakeCompletedSuccessfully(), to fix the issue, c.setHandshakeCompletedSuccessfully() will return a boolean. Internally, it will use CompareAndSwap instead of Store. If it swaps, it returns true and the done channel can be closed.
The text was updated successfully, but these errors were encountered:
This code is not goroutine(thread) safe:
https://github.com/pion/dtls/blob/e20b1620594ce408a20636f455b00ed9a3d69512/conn.go#L1031C3-L1034C4
Because the check
c.isHandshakeCompletedSuccessfully
is not in the same critical section asc.setHandshakeCompletedSuccessfully()
, to fix the issue,c.setHandshakeCompletedSuccessfully()
will return a boolean. Internally, it will useCompareAndSwap
instead ofStore
. If it swaps, it returns true and the done channel can be closed.The text was updated successfully, but these errors were encountered: