summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-01-27 23:05:52 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-01-27 23:05:52 +0100
commit4adf780d61796c45f58100ed15d9c9a0a3c562fc (patch)
treea68feee2683e58fb04ca2ce310fa4413dd452219
parent5cd316231c1f67366fda26fb302ace306ca3de3f (diff)
doc: Fix mapped-time example
One needs to use memory barriers to be sure to be reading values in the proper order. * doc/mach.texi (Host Time): Add __sync_synchronize() in mapped-time example.
-rw-r--r--doc/mach.texi2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/mach.texi b/doc/mach.texi
index 2bd085b2..dd1e5edd 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -5648,7 +5648,9 @@ mapped-time interface:
do
@{
secs = mtime->seconds;
+ __sync_synchronize();
usecs = mtime->microseconds;
+ __sync_synchronize();
@}
while (secs != mtime->check_seconds);
@end example