diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-04-17 14:12:07 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-04-17 14:12:07 +0200 |
commit | a8f59a33dc5af78faf21f1afb48358ae1918926d (patch) | |
tree | 94263310c65cdb19e5a42d5786b5f6570f07bc65 /gcc/ada/s-taprop-linux.adb | |
parent | b1b543d2c07b470207d4b347d6b2a9af6d488da7 (diff) | |
download | gcc-a8f59a33dc5af78faf21f1afb48358ae1918926d.zip gcc-a8f59a33dc5af78faf21f1afb48358ae1918926d.tar.gz gcc-a8f59a33dc5af78faf21f1afb48358ae1918926d.tar.bz2 |
[multiple changes]
2009-04-17 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb (Expand_Ctrl_Function_Call): Remove incorrect special
case for the case of an aggregate component, the attach call for the
result is actually needed.
* exp_aggr.adb (Backend_Processing_Possible): Backend processing for
an array aggregate must be disabled if the component type requires
controlled actions.
* exp_ch3.adb: Minor reformatting
2009-04-17 Arnaud Charlet <charlet@adacore.com>
* s-taprop-tru64.adb, s-taprop-vms.adb, s-taprop-linux.adb,
s-taprop-solaris.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb,
s-taprop-posix.adb (Suspend_Until_True): Protect against early wakeup.
From-SVN: r146254
Diffstat (limited to 'gcc/ada/s-taprop-linux.adb')
-rw-r--r-- | gcc/ada/s-taprop-linux.adb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb index aebfcb6..b9c3c5e 100644 --- a/gcc/ada/s-taprop-linux.adb +++ b/gcc/ada/s-taprop-linux.adb @@ -1083,7 +1083,19 @@ package body System.Task_Primitives.Operations is S.State := False; else S.Waiting := True; - Result := pthread_cond_wait (S.CV'Access, S.L'Access); + + loop + -- loop in case pthread_cond_wait returns earlier than + -- expected (e.g. in case of EINTR caused by a signal). + -- This should not happen on current implementation of pthread + -- under Linux, but POSIX does not guarantee it, so this may + -- change in the future. + + Result := pthread_cond_wait (S.CV'Access, S.L'Access); + pragma Assert (Result = 0 or else Result = EINTR); + + exit when not S.Waiting; + end loop; end if; Result := pthread_mutex_unlock (S.L'Access); |