Simple Python Solution
python\nfrom threading import Lock\n\nclass FooBar:\n    def __init__(self, n):\n        self.n = n\n        self.foo_lock = Lock()\n        self.bar_lock = Loc
```python\nfrom threading import Lock\n\nclass FooBar:\n    def __init__(self, n):\n        self.n = n\n        self.foo_lock = Lock()\n        self.bar_lock = Lock()\n        \n        # Don\'t start with bar\n        self.bar_lock.acquire()\n\n\n    def foo(self, printFoo: \'Callable[[], None]\') -> None:\n        \n        for i in range(self.n):\n            self.foo_lock.acquire()\n            printFoo()\n            self.bar_lock.release()\n\n\n    def bar(self, printBar: \'Callable[[], None]\') -> None:\n        \n        for i in range(self.n):\n            self.bar_lock.acquire()\n            printBar()\n            self.foo_lock.release()\n```
[]