Index: src/interfaces/ecpg/ecpglib/connect.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/ecpg/ecpglib/connect.c,v retrieving revision 1.20 diff -c -r1.20 connect.c *** src/interfaces/ecpg/ecpglib/connect.c 14 Mar 2004 12:16:29 -0000 1.20 --- src/interfaces/ecpg/ecpglib/connect.c 15 Mar 2004 16:17:36 -0000 *************** *** 62,79 **** { struct connection *ret = NULL; #ifdef ENABLE_THREAD_SAFETY ! pthread_mutex_lock(&connections_mutex); #endif ! ret = ecpg_get_connection_nr(connection_name); #ifdef ENABLE_THREAD_SAFETY ! pthread_mutex_unlock(&connections_mutex); #endif return (ret); - } static void --- 62,89 ---- { struct connection *ret = NULL; + if ((connection_name == NULL) || (strcmp(connection_name, "CURRENT") == 0)) + { #ifdef ENABLE_THREAD_SAFETY ! ret = pthread_getspecific(actual_connection_key); ! #else ! ret = actual_connection; ! #endif ! } ! else ! { ! #ifdef ENABLE_THREAD_SAFETY ! pthread_mutex_lock(&connections_mutex); #endif ! ret = ecpg_get_connection_nr(connection_name); #ifdef ENABLE_THREAD_SAFETY ! pthread_mutex_unlock(&connections_mutex); #endif + } return (ret); } static void