repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[build] Fix warning (#4177)
[mono-project.git]
/
mcs
/
tests
/
test-async-66.cs
blob
bbba0980228e9ebddbe0c8c6a2d42dcc5a58b416
1
using
System
;
2
using
System
.
Threading
.
Tasks
;
3
4
class
TestFinally
5
{
6
static int
counter
;
7
8
async static
Task
Test
(
bool
throwException
)
9
{
10
try
{
11
if
(
throwException
)
12
throw new
ApplicationException
();
13
14
++
counter
;
15
System
.
Console
.
WriteLine
();
16
}
finally
{
17
counter
+=
10
;
18
await
Task
.
Delay
(
2
);
19
counter
+=
100
;
20
}
21
counter
+=
1000
;
22
}
23
24
static int
Main
()
25
{
26
Test
(
false
).
Wait
();
27
if
(
counter
!=
1111
)
28
return
1
;
29
30
counter
=
0
;
31
try
{
32
Test
(
true
).
Wait
();
33
return
2
;
34
}
catch
(
AggregateException
) {
35
}
36
37
if
(
counter
!=
110
)
38
return
3
;
39
40
return
0
;
41
}
42
}