Changeset: 809114d1b333 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/809114d1b333
Modified Files:
        monetdb5/mal/mal.c
        monetdb5/mal/mal_embedded.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_namespace.c
Branch: default
Log Message:

Make sure mal_exit is only ever called from the main thread.


diffs (52 lines):

diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -249,8 +249,6 @@ void mal_reset(void)
  * terminate this way.
  * We should also ensure that no new client enters the scene while shutting 
down.
  * For this we mark the client records as BLOCKCLIENT.
- *
- * Beware, mal_exit is also called during a SIGTERM from the monetdb tool
  */
 
 void mal_exit(int status)
diff --git a/monetdb5/mal/mal_embedded.c b/monetdb5/mal/mal_embedded.c
--- a/monetdb5/mal/mal_embedded.c
+++ b/monetdb5/mal/mal_embedded.c
@@ -214,8 +214,6 @@ malEmbeddedReset(void) //remove extra mo
  * terminate this way.
  * We should also ensure that no new client enters the scene while shutting 
down.
  * For this we mark the client records as BLOCKCLIENT.
- *
- * Beware, mal_exit is also called during a SIGTERM from the monetdb tool
  */
 
 void
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -460,8 +460,8 @@ newInstructionArgs(MalBlkPtr mb, const c
                 * Furthermore, failure to allocate such a small data structure 
indicates we are in serious trouble.
                 * The only way out is declare it a fatal error, terminate the 
system to avoid crashes in all kind of places.
                 */
-               GDKerror(SQLSTATE(HY013) MAL_MALLOC_FAIL);
-               mal_exit(1);
+               GDKfatal(SQLSTATE(HY013) MAL_MALLOC_FAIL);
+               exit(1);
        }
        p->maxarg = args;
        p->typechk = TYPE_UNKNOWN;
diff --git a/monetdb5/mal/mal_namespace.c b/monetdb5/mal/mal_namespace.c
--- a/monetdb5/mal/mal_namespace.c
+++ b/monetdb5/mal/mal_namespace.c
@@ -120,8 +120,8 @@ static const char *findName(const char *
                struct namespace *ns = GDKmalloc(sizeof(struct namespace));
                if (ns == NULL) {
                        /* error we cannot recover from */
-                       TRC_CRITICAL(MAL_SERVER, MAL_MALLOC_FAIL "\n");
-                       mal_exit(1);
+                       GDKfatal(MAL_MALLOC_FAIL);
+                       exit(1);
                }
                ns->next = namespace;
                ns->count = 0;
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to