diff options
| author | Bruce Momjian | 2006-05-23 22:13:19 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2006-05-23 22:13:19 +0000 |
| commit | c1d4551ae1d63cfbff5db7b5fdec94f0357dff7b (patch) | |
| tree | 801281906612d1114eb992d19efa48547a497011 /doc/src/sgml | |
| parent | 7f52e0c50e4d3e091fb3db2432a86249029af3d4 (diff) | |
Add PQisthreadsafe() to libpq, to allow library applications to query
the thread-safety status of the library.
Diffstat (limited to 'doc/src/sgml')
| -rw-r--r-- | doc/src/sgml/libpq.sgml | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 0c24f2b773d..229e9d5a28f 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.210 2006/05/21 20:19:23 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.211 2006/05/23 22:13:19 momjian Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library</title> @@ -4196,11 +4196,32 @@ options when you compile your application code. Refer to your system's documentation for information about how to build thread-enabled applications, or look in <filename>src/Makefile.global</filename> for <literal>PTHREAD_CFLAGS</> -and <literal>PTHREAD_LIBS</>. +and <literal>PTHREAD_LIBS</>. This function allows the querying of +<application>libpq</application>'s thread-safe status: </para> +<variablelist> +<varlistentry> +<term><function>PQisthreadsafe</function><indexterm><primary>PQisthreadsafe</></></term> +<listitem> +<para> + Returns the thread safety status of the <application>libpq</application> + library. +<synopsis> +int PQisthreadsafe(); +</synopsis> +</para> + +<para> + Returns 1 if the <application>libpq</application> is thead-safe and + 0 if it is not. +</para> +</listitem> +</varlistentry> +</variablelist> + <para> -One restriction is that no two threads attempt to manipulate the same +One thread restriction is that no two threads attempt to manipulate the same <structname>PGconn</> object at the same time. In particular, you cannot issue concurrent commands from different threads through the same connection object. (If you need to run concurrent commands, use |
