AllenNeuralDynamics / AllenNeuralDynamics/brainwasher

Cleanup `flowpath_lock` debug output

オープン
#21 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
0
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

説明

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
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。