diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 08:16:14 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 08:16:14 -0500 |
commit | 4173fa3c919d309b8223ba5bfb424c3e3cb92baf (patch) | |
tree | 894fb26968d922e8e9a51817a6f54ac67d03ece9 /ntpshm.c | |
parent | 810b437d1eb5bf55cf28ed88a4e52c89b3cc2d18 (diff) | |
download | gpsd-4173fa3c919d309b8223ba5bfb424c3e3cb92baf.tar.gz |
Update for the existence of the barrier() function.
Diffstat (limited to 'ntpshm.c')
-rw-r--r-- | ntpshm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -224,9 +224,12 @@ void ntpshm_session_init(struct gps_device_t *session) int ntpshm_put(struct gps_device_t *session, int shmIndex, struct timedrift_t *td) /* put a received fix time into shared memory for NTP */ { - /* shmTime is volatile to try to prevent C compiler from reordering + /* + * shmTime is volatile to try to prevent C compiler from reordering * writes, or optimizing some 'dead code'. but CPU cache may still - * write out of order since we do not use memory barriers, yet */ + * write out of order if barrier() is a no-op (our implementation + * isn't portable). + */ volatile struct shmTime *shmTime = NULL; /* Any NMEA will be about -1 or -2. Garmin GPS-18/USB is around -6 or -7. */ int precision = -1; /* default precision */ |