Changeset: daeb22fc015d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/daeb22fc015d
Modified Files:
        gdk/gdk_bbp.c
Branch: Jan2022
Log Message:

Merge with Jul2021 branch.


diffs (43 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -132,8 +132,10 @@ static gdk_return BBPbackup(BAT *b, bool
 static gdk_return BBPdir_init(void);
 static void BBPcallbacks(void);
 
-static lng BBPlogno;           /* two lngs of extra info in BBP.dir */
-static lng BBPtransid;
+/* two lngs of extra info in BBP.dir */
+/* these two need to be atomic because of their use in AUTHcommit() */
+static ATOMIC_TYPE BBPlogno = ATOMIC_VAR_INIT(0);
+static ATOMIC_TYPE BBPtransid = ATOMIC_VAR_INIT(0);
 
 #ifdef HAVE_HGE
 /* start out by saying we have no hge, but as soon as we've seen one,
@@ -178,13 +180,13 @@ getBBPsize(void)
 lng
 getBBPlogno(void)
 {
-       return BBPlogno;
+       return (lng) ATOMIC_GET(&BBPlogno);
 }
 
 lng
 getBBPtransid(void)
 {
-       return BBPtransid;
+       return (lng) ATOMIC_GET(&BBPtransid);
 }
 
 
@@ -4100,8 +4102,8 @@ BBPsync(int cnt, bat *restrict subcommit
 
        /* AFTERMATH */
        if (ret == GDK_SUCCEED) {
-               BBPlogno = logno;       /* the new value */
-               BBPtransid = transid;
+               ATOMIC_SET(&BBPlogno, logno);   /* the new value */
+               ATOMIC_SET(&BBPtransid, transid);
                backup_files = subcommit ? (backup_files - backup_subdir) : 0;
                backup_dir = backup_subdir = 0;
                if (GDKremovedir(0, DELDIR) != GDK_SUCCEED)
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to