Added threaded/non-threaded flavor to the connection pool.
authorZdeněk Šustr <sustr4@cesnet.cz>
Mon, 4 Sep 2006 09:28:00 +0000 (09:28 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Mon, 4 Sep 2006 09:28:00 +0000 (09:28 +0000)
org.glite.lb.client/Makefile
org.glite.lb.common/Makefile
org.glite.lb.common/src/context.c

index 6acead6..ba29ed7 100644 (file)
@@ -151,7 +151,7 @@ THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la
 TOOLS:=dump load purge lb_dump_exporter ${LB_PERF_TOOLS}
 EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog
 
-EXAMPLES_CL=user_jobs job_status 
+EXAMPLES_CL=user_jobs job_status user_jobs_threaded 
 FAKE_EXAMPLES:=job_log_fake
 
 MAN_GZ:=glite-lb-logevent.1.gz
index 6d960c5..842592a 100644 (file)
@@ -247,7 +247,7 @@ il_int_test.o il_string_test.o il_test.o il_msg_test.o: %.o: %.cpp
        ${CXX} -c ${CFLAGS} ${TEST_INC} $<
 
 %.thr.o: %.c
-       ${COMPILE} ${GLOBUSTHRINC} ${CFLAGS} -o $@ -c $<
+       ${COMPILE} ${GLOBUSTHRINC} ${CFLAGS} -D_REENTRANT -DGLITE_LB_THREADED -o $@ -c $<
 
 %.h: %.h.T
        rm -f $@
index 36c4d79..b025b4c 100644 (file)
@@ -77,13 +77,15 @@ void edg_wll_FreeContext(edg_wll_Context ctx)
        if (ctx->connections->connPool) {
                int i;
 
-                /* Since the introduction of a shared connection pool, the pool cannot freed here.
-                   We only need to unlock connections locked using this context. */
+#ifdef GLITE_LB_THREADED
+                /* Since the introduction of a shared connection pool, the pool cannot be freed here.
+                   We only need to unlock connections that may have been locked using this context. */
                for (i=0; i<ctx->connections->poolSize; i++) {
                        if (ctx->connections->locked_by[i]==ctx) {
                                edg_wll_connectionUnlock(ctx, i);
                        }
                }
+#endif
 
 /*             
                for (i=0; i<ctx->connections->poolSize; i++) {