postgresql/doc
Jacob Champion b8d7685835 libpq: Add PQgetThreadLock() to mirror PQregisterThreadLock()
Allow libpq clients to retrieve the current pg_g_threadlock pointer with
PQgetThreadLock(). Single-threaded applications could already do this in
a convoluted way:

    pgthreadlock_t tlock;

    tlock = PQregisterThreadLock(NULL);
    PQregisterThreadLock(tlock);    /* re-register the callback */

    /* use tlock */

But a generic library can't do that without potentially breaking
concurrent libpq connections.

The motivation for doing this now is the libpq-oauth plugin, which
currently relies on direct injection of pg_g_threadlock, and should
ideally not.

Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://postgr.es/m/CAOYmi%2BmEU_q9sr1PMmE-4rLwFN%3DOjyndDwFZvpsMU3RNJLrM9g%40mail.gmail.com
Discussion: https://postgr.es/m/CAOYmi%2B%3DMHD%2BWKD4rsTn0v8220mYfyLGhEc5EfhmtqrAb7SmC5g%40mail.gmail.com
2026-03-05 10:04:48 -08:00
..
src libpq: Add PQgetThreadLock() to mirror PQregisterThreadLock() 2026-03-05 10:04:48 -08:00
KNOWN_BUGS Remove extra newlines at end and beginning of files, add missing newlines 2010-08-19 05:57:36 +00:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
MISSING_FEATURES Remove extra newlines at end and beginning of files, add missing newlines 2010-08-19 05:57:36 +00:00
TODO Change documentation references to PG website to use https: not http: 2017-05-20 21:50:47 -04:00