Changeset: 828426501879 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=828426501879
Modified Files:
        gdk/gdk_storage.c
Branch: unlock
Log Message:

keep extra heap reference while saving the bat


diffs (32 lines):

diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -783,14 +783,18 @@ BATsave(BAT *bd)
        /* copy the descriptor to a local variable in order to let our
         * messing in the BAT descriptor not affect other threads that
         * only read it. */
+       MT_lock_set(&bd->theaplock);
        bs = *b;
        b = &bs;
        hs = *bd->theap;
+       HEAPincref(&hs);
        b->theap = &hs;
        if (b->tvheap) {
                vhs = *bd->tvheap;
+               HEAPincref(&vhs);
                b->tvheap = &vhs;
        }
+       MT_lock_unset(&bd->theaplock);
 
        /* start saving data */
        nme = BBP_physical(b->batCacheid);
@@ -806,6 +810,9 @@ BATsave(BAT *bd)
        if (b->thash && b->thash != (Hash *) 1)
                BAThashsave(b, dosync);
 
+       HEAPdecref(b->theap, false);
+       if (b->tvheap)
+               HEAPdecref(b->tvheap, false);
        if (err == GDK_SUCCEED) {
                bd->batCopiedtodisk = true;
                DESCclean(bd);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to