--- libaitrpc/src/srv.c 2012/05/17 09:32:51 1.9.2.19 +++ libaitrpc/src/srv.c 2012/05/17 11:16:20 1.9.2.21 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.9.2.19 2012/05/17 09:32:51 misho Exp $ +* $Id: srv.c,v 1.9.2.21 2012/05/17 11:16:20 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -592,8 +592,10 @@ rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) if (!srv) return; - pthread_cancel(srv->srv_blob.tid); - pthread_join(srv->srv_blob.tid, NULL); + 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++) { @@ -602,6 +604,7 @@ rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) shutdown(c->cli_sock, SHUT_RDWR); close(c->cli_sock); + schedCancelby(srv->srv_blob.root, taskMAX, CRITERIA_ARG, c, NULL); AIT_FREE_VAL(&c->cli_buf); } io_arrayDel(srv->srv_blob.clients, i, 42); @@ -796,6 +799,7 @@ rpc_srv_endServer(rpc_srv_t ** __restrict psrv) shutdown(c->cli_sock, SHUT_RDWR); close(c->cli_sock); + schedCancelby((*psrv)->srv_root, taskMAX, CRITERIA_ARG, c, NULL); AIT_FREE_VAL(&c->cli_buf); } io_arrayDel((*psrv)->srv_clients, i, 42);