Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28430

Modified Files:
      Tag: SQL_2-24
        merovingian.mx 
Log Message:
Fix thread leak: a joinable thread lives on until someone joins on it, which in 
this case we don't do, hence a leak.  Making it detached solves the problem.

U merovingian.mx
Index: merovingian.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian.mx,v
retrieving revision 1.48.2.18
retrieving revision 1.48.2.19
diff -u -d -r1.48.2.18 -r1.48.2.19
--- merovingian.mx      27 May 2008 13:19:32 -0000      1.48.2.18
+++ merovingian.mx      7 Oct 2008 09:04:13 -0000       1.48.2.19
@@ -715,6 +715,7 @@
        stream *sfdin, *sfout;
        merovingian_proxy *pctos, *pstoc;
        pthread_t ptid;
+       pthread_attr_t detachattr;
 
        /* quick 'n' dirty parsing */
        if (strncmp(url, "mapi:monetdb://", sizeof("mapi:monetdb://") - 1) == 
0) {
@@ -801,7 +802,9 @@
        pctos->name   = GDKstrdup(client);
        pctos->co_thr = ptid;
 
-       if (pthread_create(&ptid, NULL,
+       pthread_attr_init(&detachattr);
+       pthread_attr_setdetachstate(&detachattr, PTHREAD_CREATE_DETACHED);
+       if (pthread_create(&ptid, &detachattr,
                                (void *(*)(void *))proxyThread, (void *)pctos) 
< 0)
        {
                close_stream(sfout);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to