aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-rx.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-09-05 19:05:40 -0600
committerTom Tromey <tom@tromey.com>2023-11-07 17:47:16 -0700
commit1185b5b79a12ba67eb60bee3f75babf7a222fde0 (patch)
tree8bec5accb1289ea191ae245815adcbd6e7f0df8d /bfd/elf32-rx.c
parentc6d6a048f5a6f422e470c7c4bdb21a0c59d7c8fd (diff)
downloadgdb-1185b5b79a12ba67eb60bee3f75babf7a222fde0.zip
gdb-1185b5b79a12ba67eb60bee3f75babf7a222fde0.tar.gz
gdb-1185b5b79a12ba67eb60bee3f75babf7a222fde0.tar.bz2
Add minimal thread-safety to BFD
This patch provides some minimal thread-safety to BFD. The BFD client can request thread-safety by providing a lock and unlock function. The globals used during BFD creation (e.g., bfd_id_counter) are then locked, and the file descriptor cache is also locked. A function to clean up any thread-local data is now provided for BFD clients. * bfd-in2.h: Regenerate. * bfd.c (lock_fn, unlock_fn): New globals. (bfd_thread_init, bfd_thread_cleanup, bfd_lock, bfd_unlock): New functions. * cache.c (bfd_cache_lookup_worker): Use _bfd_open_file_unlocked. (cache_btell, cache_bseek, cache_bread, cache_bwrite): Lock and unlock. (cache_bclose): Add comment. (cache_bflush, cache_bstat, cache_bmmap): Lock and unlock. (_bfd_cache_init_unlocked): New function. (bfd_cache_init): Use it. Lock and unlock. (_bfd_cache_close_unlocked): New function. (bfd_cache_close, bfd_cache_close_all): Use it. Lock and unlock. (_bfd_open_file_unlocked): New function. (bfd_open_file): Use it. Lock and unlock. * doc/bfd.texi (BFD front end): Add Threading menu item. * libbfd.h: Regenerate. * opncls.c (_bfd_new_bfd): Lock and unlock. * po/bfd.pot: Regenerate.
Diffstat (limited to 'bfd/elf32-rx.c')
0 files changed, 0 insertions, 0 deletions