postgresql/src
Tom Lane bdc79ddd10 Fix ancient bug in ecpg's pthread_once() emulation for Windows.
We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org
2020-10-24 13:12:26 -04:00
..
backend Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion 2020-10-20 19:22:09 -03:00
bin Fix connection string handling in psql's \connect command. 2020-10-21 16:19:01 -04:00
common
fe_utils
include
interfaces Fix ancient bug in ecpg's pthread_once() emulation for Windows. 2020-10-24 13:12:26 -04:00
makefiles
pl
port
template
test Use fast checkpoint in PostgresNode::backup() 2020-10-21 14:37:25 -03:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:24:07 -04:00
tools
tutorial
.gitignore
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk