]> git.ipfire.org Git - people/ms/gcc.git/commit
Use au->lock exclusively for locking in async I/O.
authorThomas König <tkoenig@gcc.gnu.org>
Thu, 13 Feb 2020 21:22:04 +0000 (22:22 +0100)
committerThomas König <tkoenig@gcc.gnu.org>
Sat, 22 Feb 2020 11:31:18 +0000 (12:31 +0100)
commitc080a6fb6f0cf402affc287fc600c189980cfb2d
tree4ecdffcee6aef4297181fdea8a9fd504208c5a31
parent3004aba7a0e041cafd2adf927e0b3a610b16e7c0
Use au->lock exclusively for locking in async I/O.

2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/93599
* io/async.c (destroy_adv_cond): Do not destroy lock.
(async_io): Make sure au->lock is locked for finishing of thread.
Do not lock/unlock around signalling emptysignal. Unlock au->lock
before return.
(init_adv_cond): Do not initialize lock.
(enqueue_transfer): Unlock after signal.
(enqueue_done_id): Likewise.
(enqueue_done): Likewise.
(enqueue_close): Likewise.
(enqueue_data_transfer): Likewise.
(async_wait_id): Do not lock/unlock around signalling au->work.
(async_wait): Unlock after signal.
* io/async.h (SIGNAL): Add comment about needed au->lock.
Remove locking/unlocking of advcond->lock.
(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
advcond->lock.  Unlock mutex only at the end.  Loop on
__ghread_cond_wait returning zero.
(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
advcond->lock.
(struct adv_cond): Remove mutex from struct.
libgfortran/ChangeLog
libgfortran/io/async.c
libgfortran/io/async.h