Python 3 - Semaphore
\nfrom threading import Semaphore\n\nclass Foo:\n    def __init__(self):\n        self.two = Semaphore(0)\n        self.three = Semaphore(0)\n\n    def first(se
```\nfrom threading import Semaphore\n\nclass Foo:\n    def __init__(self):\n        self.two = Semaphore(0)\n        self.three = Semaphore(0)\n\n    def first(self, printFirst):\n        printFirst()\n        self.two.release()\n\n    def second(self, printSecond):\n        with self.two:\n            printSecond()\n            self.three.release()\n\n    def third(self, printThird):\n        with self.three:\n            printThird()\n```
[]