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
 
        ${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 $@
 
        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++) {