Changeset: 5cc30a728c1f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5cc30a728c1f
Modified Files:
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_scenario.c
tools/monetdbe/monetdbe.c
Branch: default
Log Message:
fixed deadlock and extra protection against msab_* functions in the embedded
mode
diffs (61 lines):
diff --git a/sql/backends/monet5/sql_gencode.c
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -518,7 +518,7 @@ static int
pushInstruction(curBlk, p);
char *mal_session_uuid, *err = NULL;
- if (!GDKinmemory() && (err = msab_getUUID(&mal_session_uuid)) == NULL) {
+ if (!GDKinmemory() && !GDKembedded() && (err =
msab_getUUID(&mal_session_uuid)) == NULL) {
str lsupervisor_session = GDKstrdup(mal_session_uuid);
str rsupervisor_session = GDKstrdup(mal_session_uuid);
free(mal_session_uuid);
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -212,7 +212,7 @@ SQLepilogue(void *ret)
(void) SQLexit(NULL);
/* this function is never called, but for the style of it, we clean
* up our own mess */
- if (!GDKinmemory()) {
+ if (!GDKinmemory() && !GDKembedded()) {
res = msab_retreatScenario(m);
if (!res)
res = msab_retreatScenario(s);
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -555,6 +555,7 @@ monetdbe_dump_database(monetdbe_database
MT_lock_unset(&embedded_lock);
return msg; //The dbhdl is invalid, there is no transaction
going
}
+ MT_lock_unset(&embedded_lock);
struct MapiStruct mid;
mid.mdbe = dbhdl;
@@ -569,8 +570,6 @@ monetdbe_dump_database(monetdbe_database
} else {
msg = createException(MAL, "embedded.monetdbe_dump_database",
"Unable too open file %s", filename);
}
-
- MT_lock_unset(&embedded_lock);
return msg;
}
@@ -584,6 +583,7 @@ monetdbe_dump_table(monetdbe_database db
MT_lock_unset(&embedded_lock);
return msg; //The dbhdl is invalid, there is no transaction
going
}
+ MT_lock_unset(&embedded_lock);
struct MapiStruct mid;
mid.mdbe = dbhdl;
@@ -598,8 +598,6 @@ monetdbe_dump_table(monetdbe_database db
} else {
msg = createException(MAL, "embedded.monetdbe_dump_table",
"Unable too open file %s", filename);
}
-
- MT_lock_unset(&embedded_lock);
return msg;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list