]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46771: Implement task cancel requests counter (GH-31513)
authorTin Tvrtković <tinchester@gmail.com>
Thu, 24 Feb 2022 02:17:00 +0000 (03:17 +0100)
committerGitHub <noreply@github.com>
Thu, 24 Feb 2022 02:17:00 +0000 (18:17 -0800)
commit7fce1063b6e5a366f8504e039a8ccdd6944625cd
tree2c64b18baf6d1515d11b4959d1b1377351126104
parent6e117e75c35507f170f6a789538136477f9f226d
bpo-46771: Implement task cancel requests counter (GH-31513)

This changes cancelling() and uncancel() to return the count of pending cancellations.

This can be used to avoid bugs in certain edge cases (e.g. two timeouts going off at the same time).
Lib/asyncio/tasks.py
Modules/_asynciomodule.c
Modules/clinic/_asynciomodule.c.h