This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4332. affine_on shouldn't forward the stop token to the scheduling operation

Section: 33.13.3 [exec.affine.on] Status: New Submitter: Dietmar Kühl Opened: 2025-08-31 Last modified: 2025-09-01

Priority: Not Prioritized

View other active issues in [exec.affine.on].

View all other issues in [exec.affine.on].

View all issues with New status.

Discussion:

The main purpose of affine_on is to make sure work resumes on a specific execution context. The scheduling operation may take some time and work may be cancelled in the meantime. If this cancellation causes the scheduling to be cancelled work cleaning up after the cancellation would be executed on the wrong execution context. Thus, the stop token from the receiver's environment should only be forwarded when connecting the sender but not to the scheduling operation.

Proposed resolution: