Changeset: 3d9e2e7cb56f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d9e2e7cb56f
Modified Files:
        gdk/gdk_utils.c
Branch: default
Log Message:

Slightly more robust way of cleaning up.


diffs (31 lines):

diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -745,10 +745,11 @@ GDKreset(int status)
 {
        MT_Id pid = MT_getpid();
        Thread t, s;
-       struct serverthread *st;
        int farmid;
        int i;
 
+       assert(GDKexiting());
+
        if (GDKkey) {
                BBPunfix(GDKkey->batCacheid);
                GDKkey = NULL;
@@ -759,11 +760,12 @@ GDKreset(int status)
        }
 
        MT_lock_set(&GDKthreadLock);
-       for (st = serverthread; st; st = serverthread) {
+       while (serverthread != NULL) {
+               struct serverthread *st = serverthread;
+               serverthread = st->next;
                MT_lock_unset(&GDKthreadLock);
                MT_join_thread(st->pid);
                MT_lock_set(&GDKthreadLock);
-               serverthread = st->next;
                GDKfree(st);
        }
        MT_lock_unset(&GDKthreadLock);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to