AllenNeuralDynamics / AllenNeuralDynamics/brainwasher
Cleanup `flowpath_lock` debug output
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.