It seems like the syncvar implementation needs an equivalent of https://github.com/sandialabs/qthreads/pull/250. I've spent some time reviewing the syncvar implementation and it's distinct enough that there's not an exact analog of those changes, however we need to check that a fence happens reliably even when the value of the FEB isn't requested via the API (either by passing the same FEB as input and output or passing a null destination). The syncvar code seems much less susceptible to issues here than the aligned_t implementation was, but I'd still like to check it more carefully to make sure everything is okay.
Syncvars are correct as written due to the acq_rel ordering of qthread_cas64 when used in qthread_mwaitc which is used for the critical loads and stores for the implementation of syncvars.
It seems like the syncvar implementation needs an equivalent of https://github.com/sandialabs/qthreads/pull/250. I've spent some time reviewing the syncvar implementation and it's distinct enough that there's not an exact analog of those changes, however we need to check that a fence happens reliably even when the value of the FEB isn't requested via the API (either by passing the same FEB as input and output or passing a null destination). The syncvar code seems much less susceptible to issues here than the
aligned_t
implementation was, but I'd still like to check it more carefully to make sure everything is okay.