From: Aleš Křenek Date: Thu, 28 Sep 2006 16:56:43 +0000 (+0000) Subject: handle full pool X-Git-Tag: merge_connpool_src~11 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=df476c8044d1ee12d571d77d1f3436ee69d2301e;p=jra1mw.git handle full pool --- diff --git a/org.glite.lb.client/examples/user_jobs_threaded.c b/org.glite.lb.client/examples/user_jobs_threaded.c index 47e0b05..65b2841 100644 --- a/org.glite.lb.client/examples/user_jobs_threaded.c +++ b/org.glite.lb.client/examples/user_jobs_threaded.c @@ -7,6 +7,7 @@ #include #include +#include #include "glite/lb/context.h" #include "glite/lb/xml_conversions.h" @@ -119,6 +120,11 @@ int main(int argc,char **argv) pthread_t threads[NUM_THREADS]; pthread_attr_t attr; + if (globus_module_activate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS) { + fputs("globus_module_activate()\n",stderr); + return 1; + } + pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index a40210b..17a7560 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -185,6 +185,8 @@ int edg_wll_open(edg_wll_Context ctx, int* connToUse) ReleaseConnection(ctx, NULL, 0); index = AddConnection(ctx, ctx->srvName, ctx->srvPort); + if (index < 0) return edg_wll_SetError(ctx,EAGAIN,"connection pool size exceeded"); + #ifdef EDG_WLL_CONNPOOL_DEBUG printf("Connection to %s:%d opened as No. %d in the pool\n",ctx->srvName,ctx->srvPort,index); #endif