diff options
author | Tom Tromey <tom@tromey.com> | 2023-02-18 09:27:58 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-08 18:40:21 -0700 |
commit | da0e2ac4f7c34114da60178b4077cf6410618353 (patch) | |
tree | 30eac7ac1b5d3f2b2138ae8edf4d0faa829ab7ed /gdb/defs.h | |
parent | a2eb3f887cba11c87b625dbbd058557025e57596 (diff) | |
download | binutils-da0e2ac4f7c34114da60178b4077cf6410618353.zip binutils-da0e2ac4f7c34114da60178b4077cf6410618353.tar.gz binutils-da0e2ac4f7c34114da60178b4077cf6410618353.tar.bz2 |
Add thread-safety to gdb's BFD wrappers
This changes gdb to ensure that gdb's BFD cache is guarded by a lock.
This avoids any races when multiple threads might open a BFD (and thus
use the BFD cache) at the same time.
Currently, this change is not needed because the the main thread waits
for some DWARF scanning to be completed before returning. The only
locking that's required is when opening DWO files, and there's a local
lock to this end in dwarf2/read.c.
However, in the coming patches, the DWARF reader will begin its work
earlier, in the background. This means there is the potential for the
DWARF reader and other code on the main thread to both attempt to open
BFDs at the same time.
Diffstat (limited to 'gdb/defs.h')
0 files changed, 0 insertions, 0 deletions