Py3 Runtime: 32 ms, faster than 93.93%
Using thread lock and lock first and second first at the begining, then release first when printFirst being called, and release second when printSecond being ca
Using thread lock and lock `first` and `second` first at the begining, then release `first` when `printFirst` being called, and release `second` when `printSecond` being called. After all `printThird` will be called.\n\n```class Foo:\n    def __init__(self):\n        self.tl1 = threading.Lock()\n        self.tl2 = threading.Lock()\n        self.tl1.acquire()\n        self.tl2.acquire()\n\n\n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        # printFirst() outputs "first". Do not change or remove this line.\n        printFirst()\n        self.tl1.release()\n\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n        self.tl1.acquire()\n        # printSecond() outputs "second". Do not change or remove this line.\n        printSecond()\n        self.tl2.release()\n\n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n        self.tl2.acquire()\n        # printThird() outputs "third". Do not change or remove this line.\n        printThird()\n        ```\n\t\t
['Python3']