def semaphore(count: int, bounded: bool=False):
lock_type = threading.BoundedSemaphore if bounded else threading.Semaphore<EOL>lock_obj = lock_type(value=count)<EOL>return with_it(lock_obj)<EOL>
use `Semaphore` to keep func access thread-safety.

example:

``` py
@semaphore(3)
def func(): pass
```