diff --git a/psycopg/config.h b/psycopg/config.h index 551cfe4..90d14b4 100644 --- a/psycopg/config.h +++ b/psycopg/config.h @@ -41,10 +41,11 @@ extern HIDDEN int psycopg_debug_enabled; #if defined( __GNUC__) && !defined(__APPLE__) #ifdef PSYCOPG_DEBUG #include +#include #include #define Dprintf(fmt, args...) \ if (!psycopg_debug_enabled) ; else \ - fprintf(stderr, "[%d] " fmt "\n", (int) getpid() , ## args) + fprintf(stderr, "[%d %ld] " fmt "\n", (int) getpid(), (long) syscall(SYS_gettid), ## args) #else #define Dprintf(fmt, args...) #endif diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index c5daefd..95057d0 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -842,6 +842,7 @@ INIT_MODULE(_psycopg)(void) #endif Dprintf("initpsycopg: initializing psycopg %s", PSYCOPG_VERSION); + Dprintf("is libpq thread safe? %d", PQisthreadsafe()); /* initialize all the new types and then the module */ Py_TYPE(&connectionType) = &PyType_Type;