From: Zdeněk Šustr Date: Wed, 4 Apr 2012 12:19:33 +0000 (+0000) Subject: Unlock pool before leaving mutex through goto! X-Git-Tag: glite-px-proxyrenewal_R_1_3_25_2~42 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7be1b16d2bc45c4f81f0e25b590968d355f1d1d2;p=jra1mw.git Unlock pool before leaving mutex through goto! --- diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index 0418e26..45ba4e7 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -304,11 +304,15 @@ int edg_wll_open(edg_wll_Context ctx, int* connToUse) if ( (index = ConnectionIndex(ctx, ctx->srvName, ctx->srvPort)) == -1 ) { /* no such open connection in pool */ if (ctx->connections->connOpened == ctx->connections->poolSize) - if(ReleaseConnection(ctx, NULL, 0)) goto end; + if(ReleaseConnection(ctx, NULL, 0)) { + edg_wll_poolUnlock(); + goto end; + } index = AddConnection(ctx, ctx->srvName, ctx->srvPort); if (index < 0) { edg_wll_SetError(ctx,EAGAIN,"connection pool size exceeded"); + edg_wll_poolUnlock(); goto end; } diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index 3d1a2ff..4bba21b 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -249,11 +249,13 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) if (ctx->connections->connOpened == ctx->connections->poolSize) if (ReleaseConnection(ctx, NULL, 0)) { answer = edg_wll_SetError(ctx,EAGAIN,"cannot release connection (pool size exceeded)"); + edg_wll_poolUnlock(); goto edg_wll_log_connect_end; } index = AddConnection(ctx, ctx->p_destination, ctx->p_dest_port); if (index < 0) { answer = edg_wll_SetError(ctx,EAGAIN,"cannot add connection to pool"); + edg_wll_poolUnlock(); goto edg_wll_log_connect_end; } #ifdef EDG_WLL_LOG_STUB