diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2023-07-11 17:57:14 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-28 09:28:14 +0200 |
commit | 5bd09a25b342f980f0596c9e354c54a4c635ec65 (patch) | |
tree | 8f84fd1b7ab1404daa42a8ef7d68421fd7f68d76 /gcc/tree-ssa-loop-manip.cc | |
parent | f30396a0e1887cc5d5bf712f4f45bc37c90a3c7c (diff) | |
download | gcc-5bd09a25b342f980f0596c9e354c54a4c635ec65.zip gcc-5bd09a25b342f980f0596c9e354c54a4c635ec65.tar.gz gcc-5bd09a25b342f980f0596c9e354c54a4c635ec65.tar.bz2 |
ada: Fix race condition in protected entry call
This patch only affects the single-entry implementation of protected
objects.
Before this patch, there was a race condition where a task that
called an entry could put itself to sleep right after another task
had executed the entry as a proxy and signalled the not-yet-waiting
first task, which caused the first task to enter a deadlock.
Note that this race condition has been identified and fixed before
for the implementations of the run-time that live under hie/.
This patch reworks the locking sequence so that it is closer to the
one that's used in the multiple-entry implementation of protected
objects. The code for the multiple-entry implementation is spread
across multiple subprograms. To draw a parallel with the section
this patch modifies, one can read the following subprograms:
- System.Tasking.Protected_Objects.Operations.Protected_Entry_Call
- System.Tasking.Entry_Calls.Wait_For_Completion
- System.Tasking.Entry_Calls.Check_Pending_Actions_For_Entry_Call
This patch also adds a comment that explicitly states the locking
constraint that must hold in the affected section.
gcc/ada/
* libgnarl/s-tposen.adb: Fix race condition. Add comment to justify
the locking timing.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.cc')
0 files changed, 0 insertions, 0 deletions