aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/final.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-11-20 12:13:40 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-11-20 12:13:40 +0100
commit6c802906a388f6816ba641f8ec83ef812ffe8fbd (patch)
tree935169c8313a4ed8a666888be5c53e913f041f63 /gcc/ada/final.c
parent4b963531a13ebfef4fd889df305d4037e7334fa0 (diff)
downloadgcc-6c802906a388f6816ba641f8ec83ef812ffe8fbd.zip
gcc-6c802906a388f6816ba641f8ec83ef812ffe8fbd.tar.gz
gcc-6c802906a388f6816ba641f8ec83ef812ffe8fbd.tar.bz2
[multiple changes]
2014-11-20 Pascal Obry <obry@adacore.com> * initialize.c (ProcListCS): New extern variable (critical section). (ProcListEvt): New extern variable (handle). (__gnat_initialize)[Win32]: Initialize the ProcListCS critical section object and the ProcListEvt event. * final.c (__gnat_finalize)[Win32]: Properly finalize the ProcListCS critical section and the ProcListEvt event. * adaint.c (ProcListEvt): New Win32 event handle. (EnterCS): New routine to enter the critical section when dealing with child processes chain list. (LeaveCS): As above to exit from the critical section. (SignalListChanged): Routine to signal that the chain process list has been updated. (add_handle): Use EnterCS/LeaveCS, also call SignalListChanged when the handle has been added. (__gnat_win32_remove_handle): Use EnterCS/LeaveCS, also call SignalListChanged if the handle has been found and removed. (remove_handle): Routine removed, implementation merged with the above. (win32_wait): Use EnterCS/LeaveCS for the critical section. Properly copy the PID list locally to ensure that even if the list is updated the local copy remains valid. Add into the hl (handle list) the ProcListEvt handle. This handle is used to signal that a change has been made into the process chain list. This is to ensure that a waiting call can be resumed to take into account new processes. We also make sure that if the handle was not found into the list we start over the wait call. Indeed another concurrent call to win32_wait() could already have handled this process. 2014-11-20 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Actuals): The legality rule concerning the use of class-wide actuals for a non-controlling formal are not rechecked in an instance. 2014-11-20 Pascal Obry <obry@adacore.com> * g-dirope.ads: Minor typo fix. 2014-11-20 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, Expand_Update_Attribute): Preserve the tag of a prefix by offering a specific view of the class-wide version of the prefix. From-SVN: r217837
Diffstat (limited to 'gcc/ada/final.c')
-rw-r--r--gcc/ada/final.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ada/final.c b/gcc/ada/final.c
index b49b3de..dffc2b2 100644
--- a/gcc/ada/final.c
+++ b/gcc/ada/final.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2011, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2014, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -40,10 +40,28 @@ extern void __gnat_finalize (void);
at all, the intention is that this be replaced by system specific code
where finalization is required. */
+#if defined (__MINGW32__)
+#include "mingw32.h"
+#include <windows.h>
+
+extern CRITICAL_SECTION ProcListCS;
+extern HANDLE ProcListEvt;
+
+void
+__gnat_finalize (void)
+{
+ /* delete critical section and event handle used for the
+ processes chain list */
+ DeleteCriticalSection(&ProcListCS);
+ CloseHandle (ProcListEvt);
+}
+
+#else
void
__gnat_finalize (void)
{
}
+#endif
#ifdef __cplusplus
}