--- libaitrpc/src/lists.c 2012/03/29 01:34:16 1.8 +++ libaitrpc/src/lists.c 2012/05/14 08:39:06 1.9 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: lists.c,v 1.8 2012/03/29 01:34:16 misho Exp $ +* $Id: lists.c,v 1.9 2012/05/14 08:39:06 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -136,10 +136,8 @@ rpc_srv_registerCall(rpc_srv_t * __restrict srv, const } /* add to list of functions */ - pthread_mutex_lock(&srv->srv_mtx); func->func_next = srv->srv_funcs; srv->srv_funcs = func; - pthread_mutex_unlock(&srv->srv_mtx); return 0; } @@ -166,14 +164,11 @@ rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con if (rpc_calcHashes(&func, csModule, csFunc) == -1) return -1; - pthread_mutex_lock(&srv->srv_mtx); f = rpc_srv_getCall(srv, func.func_tag, func.func_hash); AIT_FREE_VAL(&func.func_name); AIT_FREE_VAL(&func.func_file); - if (!f) { /* not found element for unregister */ - pthread_mutex_unlock(&srv->srv_mtx); + if (!f) /* not found element for unregister */ return 0; - } /* remove from list of functions */ if (srv->srv_funcs == f) /* if is 1st element */ @@ -186,7 +181,6 @@ rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con AIT_FREE_VAL(&f->func_name); AIT_FREE_VAL(&f->func_file); free(f); - pthread_mutex_unlock(&srv->srv_mtx); return 1; } @@ -292,10 +286,8 @@ rpc_srv_registerBLOB(rpc_srv_t * __restrict srv, size_ blob = rpc_srv_blobCreate(srv, len); if (blob) { - pthread_mutex_lock(&srv->srv_blob.mtx); blob->blob_next = srv->srv_blob.blobs; srv->srv_blob.blobs = blob; - pthread_mutex_unlock(&srv->srv_blob.mtx); } return blob; @@ -325,14 +317,12 @@ rpc_srv_unregisterBLOB(rpc_srv_t * __restrict srv, uin if (b->blob_data) rpc_srv_blobUnmap(b); - pthread_mutex_lock(&srv->srv_blob.mtx); if (srv->srv_blob.blobs == b) { /* if is 1st element */ srv->srv_blob.blobs = srv->srv_blob.blobs->blob_next; } else { for (curr = srv->srv_blob.blobs; curr->blob_next != b; curr = curr->blob_next); curr->blob_next = curr->blob_next->blob_next; } - pthread_mutex_unlock(&srv->srv_blob.mtx); rpc_srv_blobFree(srv, b); free(b);