]> git.sur5r.net Git - openldap/commitdiff
ITS#7969 Use __sync_synchronize()
authorleo@yuriev.ru <leo@yuriev.ru>
Fri, 3 Jul 2015 21:01:00 +0000 (23:01 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 25 Oct 2015 09:55:21 +0000 (10:55 +0100)
The rest of 9a80a8a8e8feed56fbccd8851b8a789f7fff9c11
plus commit a937740aa0c47dc7a1a5e9be42dcea2dd3c81683.

libraries/liblmdb/mdb.c

index 797c67b32e5cac99cedc3bee2f7f9b5a7f1aee9d..2ee0b6a149e8b07c9c58250d2ca05c79f02f324d 100644 (file)
@@ -3643,6 +3643,11 @@ mdb_env_write_meta(MDB_txn *txn)
                mp->mm_dbs[0] = txn->mt_dbs[0];
                mp->mm_dbs[1] = txn->mt_dbs[1];
                mp->mm_last_pg = txn->mt_next_pgno - 1;
+#if (__GNUC__ * 100 + __GNUC_MINOR__ >= 404) && /* TODO: portability */        \
+       !(defined(__i386__) || defined(__x86_64__))
+               /* LY: issue a memory barrier, if not x86. ITS#7969 */
+               __sync_synchronize();
+#endif
                mp->mm_txnid = txn->mt_txnid;
                if (!(flags & (MDB_NOMETASYNC|MDB_NOSYNC))) {
                        unsigned meta_size = env->me_psize;