Represents a lock that is tracked upon instantiation using a WeakSet and reset by pymongo upon forking.
()
| 44 | |
| 45 | |
| 46 | def _create_lock() -> threading.Lock: |
| 47 | """Represents a lock that is tracked upon instantiation using a WeakSet and |
| 48 | reset by pymongo upon forking. |
| 49 | """ |
| 50 | lock = threading.Lock() |
| 51 | if _HAS_REGISTER_AT_FORK: |
| 52 | _forkable_locks.add(lock) |
| 53 | return lock |
| 54 | |
| 55 | |
| 56 | def _async_create_lock() -> Lock: |