summaryrefslogtreecommitdiff
path: root/src/backend/executor/execCurrent.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-10-24 13:12:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-10-24 13:12:19 -0400
commitfd048e0cb5aa45ef67b5b2b0446f4b1b6bdefbf3 (patch)
tree4f5c31fd413106792eabb6348a5e41e844575eb0 /src/backend/executor/execCurrent.c
parente4538708d58400c8c0336ebabca0b7bdb72e0ff6 (diff)
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
Diffstat (limited to 'src/backend/executor/execCurrent.c')
0 files changed, 0 insertions, 0 deletions