AllenNeuralDynamics / AllenNeuralDynamics/brainwasher
Cleanup `flowpath_lock` debug output
Ouverte
- Langage dominant
- Python
- Étoiles
- 0
- Forks
- 1
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.