C# AutoResetEvent 116ms
\nusing System.Threading;\n\npublic class Foo {\n    EventWaitHandle evnt1 = null;\n    EventWaitHandle evnt2 = null;\n    public Foo() {\n        evnt1 = new A
```\nusing System.Threading;\n\npublic class Foo {\n    EventWaitHandle evnt1 = null;\n    EventWaitHandle evnt2 = null;\n    public Foo() {\n        evnt1 = new AutoResetEvent(false);\n        evnt2 = new AutoResetEvent(false);\n    }\n\n    public void First(Action printFirst) {\n        \n        // printFirst() outputs "first". Do not change or remove this line.\n        printFirst();\n        evnt1.Set();\n    }\n\n    public void Second(Action printSecond) {\n        \n        evnt1.WaitOne();\n        // printSecond() outputs "second". Do not change or remove this line.\n        printSecond();\n        evnt2.Set();\n    }\n\n    public void Third(Action printThird) {\n        evnt2.WaitOne();\n        // printThird() outputs "third". Do not change or remove this line.\n        printThird();\n        evnt2.Set();\n    }\n}\n```
[]