[interp] Reduce computation under calc_section mutex
[mono-project.git] / mcs / tests / test-iter-11.cs
blob91f016d3915ef79690d00d1142b36be89e94ea68
1 using System;
2 using System.Collections;
4 class X {
5 public event EventHandler Hook;
7 public IEnumerator Pipeline ()
9 if (Hook == null)
10 throw new Exception ("error");
12 Hook (this, EventArgs.Empty);
14 yield return 0;
17 static void M (object sender, EventArgs args)
19 Console.WriteLine ("Hook invoked");
22 public static void Main ()
24 X x = new X ();
25 x.Hook += M;
26 IEnumerator y = x.Pipeline ();
27 y.MoveNext ();