Changeset: 301996c4409d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=301996c4409d
Modified Files:
gdk/gdk_bbp.c
Branch: Aug2018
Log Message:
Don't take lock before entering incref.
incref may have to call itself recursively in case a view is involved;
this recursive call will try to take a lock which could be the one
that we lock here (it's on a different BAT, but BATs share locks).
diffs (20 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2437,14 +2437,14 @@ BBPshare(bat parent)
bool lock = locked_by == 0 || locked_by != MT_getpid();
assert(parent > 0);
+ (void) incref(parent, true, lock);
if (lock)
MT_lock_set(&GDKswapLock(parent));
- (void) incref(parent, true, 0);
++BBP_cache(parent)->batSharecnt;
assert(BBP_refs(parent) > 0);
- (void) incref(parent, false, 0);
if (lock)
MT_lock_unset(&GDKswapLock(parent));
+ (void) incref(parent, false, lock);
}
static inline int
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list