using System.Threading;
public class Foo {
public Foo() {
}
static AutoResetEvent _Second = new AutoResetEvent(false);
static AutoResetEvent _Third = new AutoResetEvent(false);
public void First(Action printFirst) {
// printFirst() outputs "first". Do not change or remove this line.
printFirst();
_Second.Set();
}
public void Second(Action printSecond) {
_Second.WaitOne();
// printSecond() outputs "second". Do not change or remove this line.
printSecond();
_Third.Set();
}
public void Third(Action printThird) {
_Third.WaitOne();
// printThird() outputs "third". Do not change or remove this line.
printThird();
}
}