Title: gh-141196: Fix threading.Semaphore documentation inconsistency by mohsinm-dev · Pull Request #141244 · python/cpython · GitHub
Open Graph Title: gh-141196: Fix threading.Semaphore documentation inconsistency by mohsinm-dev · Pull Request #141244 · python/cpython
X Title: gh-141196: Fix threading.Semaphore documentation inconsistency by mohsinm-dev · Pull Request #141244 · python/cpython
Description: Fixes issue #141196 by correcting inconsistent documentation in threading.Semaphore. The acquire() method documentation stated 'Exactly one thread will be awoken by each call to release()' which became incorrect when the n parameter was added to release() in Python 3.9. Updated acquire() docs to reflect that release(n) wakes min(j,n) threads where j = waiting threads, and clarified release() docs to specify 'up to n threads' are awakened. The fix aligns documentation with actual behavior: Semaphore.release(n) calls Condition.notify(n), which wakes exactly min(n, waiting_threads) threads. Documentation-only change, no code modifications required. Issue: gh-141196 📚 Documentation preview 📚: https://cpython-previews--141244.org.readthedocs.build/
Open Graph Description: Fixes issue #141196 by correcting inconsistent documentation in threading.Semaphore. The acquire() method documentation stated 'Exactly one thread will be awoken by each call to release()' ...
X Description: Fixes issue #141196 by correcting inconsistent documentation in threading.Semaphore. The acquire() method documentation stated 'Exactly one thread will be awoken by each call to release()&a...
Opengraph URL: https://github.com/python/cpython/pull/141244
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:432c9ff1-edc4-bfa0-47e1-10e9efac60dc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A1E8:FE4F6:1E86C4:298844:6A52722C |
| html-safe-nonce | 35223a0c3e6d6f0da4cf1e972f3e73f105de31b5db7709a9f4d52999a5ece273 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUU4OkZFNEY2OjFFODZDNDoyOTg4NDQ6NkE1MjcyMkMiLCJ2aXNpdG9yX2lkIjoiODIwNDkyNDMxOTM5MTk2OTgzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9ced5895cde9dacfc82a424811715651ed1cf5b516de7e701a3912628652ddef |
| hovercard-subject-tag | pull_request:2991445675 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/141244/files |
| twitter:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55545648?s=400&v=4 |
| og:image:alt | Fixes issue #141196 by correcting inconsistent documentation in threading.Semaphore. The acquire() method documentation stated 'Exactly one thread will be awoken by each call to release()' ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width