Changeset: 020c047fa49b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=020c047fa49b
Modified Files:
        gdk/gdk_orderidx.c
Branch: Dec2016
Log Message:

Do the work outside of the lock.


diffs (23 lines):

diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -551,7 +551,10 @@ OIDXdestroy(BAT *b)
                Heap *hp;
 
                MT_lock_set(&GDKhashLock(b->batCacheid));
-               if ((hp = b->torderidx) == (Heap *) 1) {
+               hp = b->torderidx;
+               b->torderidx = NULL;
+               MT_lock_unset(&GDKhashLock(b->batCacheid));
+               if (hp == (Heap *) 1) {
                        GDKunlink(BBPselectfarm(b->batRole, b->ttype, 
orderidxheap),
                                  BATDIR,
                                  BBP_physical(b->batCacheid),
@@ -560,7 +563,5 @@ OIDXdestroy(BAT *b)
                        HEAPdelete(hp, BBP_physical(b->batCacheid), 
"torderidx");
                        GDKfree(hp);
                }
-               b->torderidx = NULL;
-               MT_lock_unset(&GDKhashLock(b->batCacheid));
        }
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to