diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-05-23 22:13:19 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-05-23 22:13:19 +0000 |
commit | c1d4551ae1d63cfbff5db7b5fdec94f0357dff7b (patch) | |
tree | 801281906612d1114eb992d19efa48547a497011 /src/interfaces/libpq/fe-exec.c | |
parent | 7f52e0c50e4d3e091fb3db2432a86249029af3d4 (diff) |
Add PQisthreadsafe() to libpq, to allow library applications to query
the thread-safety status of the library.
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 31393989468..7b999c85330 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.183 2006/05/21 20:19:23 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.184 2006/05/23 22:13:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2343,6 +2343,18 @@ PQisnonblocking(const PGconn *conn) return pqIsnonblocking(conn); } +/* libpq is thread-safe? */ +int +PQisthreadsafe(void) +{ +#ifdef ENABLE_THREAD_SAFETY + return true; +#else + return false; +#endif +} + + /* try to force data out, really only useful for non-blocking users */ int PQflush(PGconn *conn) |