Changeset: 535799f927f9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/535799f927f9 Modified Files: gdk/gdk_align.c gdk/gdk_heap.c Branch: Jan2022 Log Message:
Slightly better placement of lock/unlock calls. diffs (36 lines): diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -100,17 +100,15 @@ VIEWcreate(oid seq, BAT *b) * because in case of a mark, we are going to override a * column with a void. Take care to zero the accelerator data, * though. */ + MT_lock_set(&b->theaplock); bn->batInserted = b->batInserted; bn->batCount = b->batCount; bn->batCapacity = b->batCapacity; - MT_lock_set(&b->theaplock); bn->T = b->T; tp = VIEWtparent(b); if (tp == 0 && b->ttype != TYPE_void) tp = b->batCacheid; assert(b->ttype != TYPE_void || !tp); - /* copy again now we have the correct lock */ - bn->theap = b->theap; HEAPincref(b->theap); if (b->tvheap) HEAPincref(b->tvheap); diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c --- a/gdk/gdk_heap.c +++ b/gdk/gdk_heap.c @@ -647,9 +647,9 @@ GDKupgradevarheap(BAT *b, var_t v, BUN c b->twidth = width; if (cap > BATcapacity(b)) BATsetcapacity(b, cap); - HEAPdecref(old, strcmp(old->filename, new->filename) != 0); b->theap = new; MT_lock_unset(&b->theaplock); + HEAPdecref(old, strcmp(old->filename, new->filename) != 0); return GDK_SUCCEED; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list