AllenNeuralDynamics / AllenNeuralDynamics/brainwasher
Cleanup `flowpath_lock` debug output
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Acquiring the `RLock` should disambiguate if we have already acquired it and not print the same message.
We can do this with:
```python
import threading
rlock = threading.RLock()
# Check if we are acquiring it for the first time.
try:
if rlock.acquire(blocking=False): # reacquiring
fn()
else:
printf("rlock acquired for the first time.")
rlock.acquire() # First acquisition
fn()
finally:
rlock.release() # Release the initial acquisition
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.