--- libaitrpc/src/srv.c 2012/05/17 15:18:48 1.9.2.24 +++ libaitrpc/src/srv.c 2012/05/17 15:48:45 1.9.2.25 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.9.2.24 2012/05/17 15:18:48 misho Exp $ +* $Id: srv.c,v 1.9.2.25 2012/05/17 15:48:45 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -602,11 +602,6 @@ rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) if (!srv) return; - if (srv->srv_blob.tid) { - pthread_cancel(srv->srv_blob.tid); - pthread_join(srv->srv_blob.tid, NULL); - } - /* close all clients connections & server socket */ for (i = 0; i < io_arraySize(srv->srv_blob.clients); i++) { c = io_array(srv->srv_blob.clients, i, rpc_cli_t*); @@ -620,6 +615,10 @@ rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) io_arrayDel(srv->srv_blob.clients, i, 42); } io_arrayDestroy(&srv->srv_blob.clients); + + srv->srv_blob.kill = 1; + if (srv->srv_blob.tid) + pthread_cancel(srv->srv_blob.tid); close(srv->srv_blob.server.cli_sock);