Skip to content

device: Add a memory barrier when getting session pointer

Benjamin Berg requested to merge benzea/memory-barrier into master

The test suite ran into a very rare error where it seemed to get stuck during authorization. A possible explanation is that the priv->_session pointer re-fetching is optimized away and the pointer just continues to contain the invalid placeholder rather than an updated value.

Use g_atomic_pointer_get in order to avoid this possibility entirely.

Well, best explanation for https://gitlab.freedesktop.org/weblate/fprintd/-/jobs/12126999#L1031 that I can think of. Obviously one of the authorization threads just got stuck for more than 25 seconds.

Merge request reports

Loading