]>
Commit | Line | Data |
---|---|---|
42a4f53d | 1 | -- Copyright 2017-2019 Free Software Foundation, Inc. |
e05fa6f9 JB |
2 | -- |
3 | -- This program is free software; you can redistribute it and/or modify | |
4 | -- it under the terms of the GNU General Public License as published by | |
5 | -- the Free Software Foundation; either version 3 of the License, or | |
6 | -- (at your option) any later version. | |
7 | -- | |
8 | -- This program is distributed in the hope that it will be useful, | |
9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | -- GNU General Public License for more details. | |
12 | -- | |
13 | -- You should have received a copy of the GNU General Public License | |
14 | -- along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | with Ada.Text_IO; use Ada.Text_IO; | |
17 | ||
18 | procedure Crash is | |
19 | ||
20 | procedure Request_For_Crash is | |
21 | begin | |
22 | null; -- Just an anchor for the debugger... | |
23 | end Request_For_Crash; | |
24 | ||
25 | task type T is | |
26 | entry Done; | |
27 | end T; | |
28 | ||
29 | task body T is | |
30 | begin | |
31 | accept Done do | |
32 | null; | |
33 | end Done; | |
34 | Put_Line ("Task T: Rendez-vous completed."); | |
35 | end T; | |
36 | ||
37 | My_T : T; | |
38 | ||
39 | begin | |
40 | ||
41 | -- Give some time for the task to be created, and start its execution, | |
42 | -- so that it reaches the accept statement. | |
43 | delay 0.01; | |
44 | ||
45 | Request_For_Crash; | |
46 | ||
47 | delay 0.01; | |
48 | Put_Line ("*** We didn't crash !?!"); | |
49 | ||
50 | -- Complete the rendez-vous with our task, so it can complete. | |
51 | My_T.Done; | |
52 | ||
53 | end Crash; |