()
| 55 | ) |
| 56 | |
| 57 | def thread_target(): |
| 58 | # Create a lock instance in each thread |
| 59 | lock = Lock() |
| 60 | try: |
| 61 | lock.acquire() |
| 62 | except Exception: |
| 63 | pass |
| 64 | finally: |
| 65 | lock.release() |
| 66 | |
| 67 | threads = [threading.Thread(target=thread_target, args=()) for _ in range(10)] |
| 68 |