Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
Needs ReviewPublic

Authored by kevans on Thu, Jun 13, 5:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 19, 5:31 PM
Unknown Object (File)
Sun, Jun 16, 4:47 AM
Subscribers

Details

Reviewers
kib
Summary

This effectively reverts
6e824f3713011 ("time: siginfo_recvd needs to be marked volatile")
because it was actually wrong. Switch to C11 signal fence, which
provides a compiler barrier that will do the right thing.

Reported by: kib

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58159
Build 55047: arc lint + arc unit

Event Timeline

usr.bin/time/time.c
130

I think that the right code is

local_siginfo_recvd = siginfo_recvd;
atomic_signal_fence(acq);
if (local siginfo_recvd) {
  ....

[Fence should come after reading the flag variable]