diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 08:23:00 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 08:23:00 -0500 |
commit | 783cc0486f5b4994807da44eff7e22efcc173c5a (patch) | |
tree | 0e92ee4d63b1e8d5b6725a3810cdf44a080dec72 /libgps_shm.c | |
parent | 4173fa3c919d309b8223ba5bfb424c3e3cb92baf (diff) | |
download | gpsd-783cc0486f5b4994807da44eff7e22efcc173c5a.tar.gz |
Clarifying name change. All regression test pass. PPS is live.
Diffstat (limited to 'libgps_shm.c')
-rw-r--r-- | libgps_shm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libgps_shm.c b/libgps_shm.c index 88b340e8..5f79aee2 100644 --- a/libgps_shm.c +++ b/libgps_shm.c @@ -75,10 +75,10 @@ bool gps_shm_waiting(const struct gps_data_t *gpsdata, int timeout) /* busy-waiting sucks, but there's not really an alternative */ for (;;) { bool newdata = false; - barrier(); + memory_barrier(); if (shared->bookend1 == shared->bookend2 && shared->bookend1 > PRIVATE(gpsdata)->tick) newdata = true; - barrier(); + memory_barrier(); if (newdata || (timestamp() - basetime >= (double)timeout)) break; } @@ -100,9 +100,9 @@ int gps_shm_read(struct gps_data_t *gpsdata) struct gps_data_t noclobber; /* - * Following block of instructions must not be reordered, otherwise - * havoc will ensue. The barrier() call should prevent reordering - * of the data accesses. + * Following block of instructions must not be reordered, + * otherwise havoc will ensue. The memory_barrier() call + * should prevent reordering of the data accesses. * * This is a simple optimistic-concurrency technique. We wrote * the second bookend first, then the data, then the first bookend. @@ -111,11 +111,11 @@ int gps_shm_read(struct gps_data_t *gpsdata) * get clobbered first and the data can be detected as bad. */ before = shared->bookend1; - barrier(); + memory_barrier(); (void)memcpy((void *)&noclobber, (void *)&shared->gpsdata, sizeof(struct gps_data_t)); - barrier(); + memory_barrier(); after = shared->bookend2; if (before != after) |