Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Commit7ec656e
committed
gh-141196: Fix threading.Semaphore documentation inconsistency
The acquire() method documentation stated 'Exactly one thread will be awokenby each call to release()' which became incorrect when the n parameter wasadded to release() in Python 3.9.The release() method documentation was ambiguous about behavior whenn > waiting_threads.Changes:- acquire(): Updated to reflect that release(n) wakes min(j,n) threads where j = waiting threads- release(): Clarified that it wakes 'up to n' threads, or all available if fewer than n are waitingThe fix aligns documentation with actual implementation behavior inLib/threading.py where release(n) calls Condition.notify(n).1 parentd13ee0a commit7ec656e
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
| |||
1166 | 1168 | | |
1167 | 1169 | | |
1168 | 1170 | | |
1169 | | - | |
| 1171 | + | |
| 1172 | + | |
1170 | 1173 | | |
1171 | 1174 | | |
1172 | 1175 | | |
| |||
0 commit comments
Comments
(0)