AllenNeuralDynamics / AllenNeuralDynamics/brainwasher
Cleanup `flowpath_lock` debug output
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.