Skip to content

📝 docs(how-to): probe with blocking=False - #873

Merged
gaborbernat merged 3 commits into
tox-dev:mainfrom
tongwentao:docs/nonblocking-lock-probe
Oct 28, 2026
Merged

gaborbernat merged 3 commits into
tox-dev:mainfrom
tongwentao:docs/nonblocking-lock-probe

Conversation

@tongwentao

@tongwentao tongwentao commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The "Probe a lock before blocking on it" recipe approximated a single attempt with timeout=0.0001. A finite timeout still polls, and a reader copying the recipe learns a workaround where the library has a flag for the case. 📝 The recipe now probes with blocking=False, the one-attempt form the guide's "Use non-blocking locks" section already documents, and the rest of the recipe (one log line on contention, a blocking wait, one balanced release()) is unchanged.

tongwentao and others added 3 commits October 22, 2026 14:49
The "Use non-blocking locks" section already explains that blocking=False
makes one attempt, so the recipe keeps only the line that changed. The
fragment takes the descriptive name CONTRIBUTING asks for and names the
replaced approach.
@gaborbernat gaborbernat changed the title docs: use a nonblocking attempt in the lock-probing recipe 📝 docs(how-to): probe with blocking=False Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat
gaborbernat merged commit 9a70a71 into tox-dev:main Oct 28, 2026
114 of 198 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants