gh-115999: Add free-threaded specialization for SEND (gh-127426)

No additional thread safety changes are required.  Note that sending to
a generator that is shared between threads is currently not safe in the
free-threaded build.
This commit is contained in:
Neil Schemenauer 2024-12-03 10:25:12 -08:00 committed by GitHub
parent 13b68e1a61
commit 276cd66ccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 50 additions and 15 deletions

View file

@ -7065,7 +7065,7 @@
receiver = stack_pointer[-2];
uint16_t counter = read_u16(&this_instr[1].cache);
(void)counter;
#if ENABLE_SPECIALIZATION
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_PyFrame_SetStackPointer(frame, stack_pointer);
@ -7075,7 +7075,7 @@
}
OPCODE_DEFERRED_INC(SEND);
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
#endif /* ENABLE_SPECIALIZATION */
#endif /* ENABLE_SPECIALIZATION_FT */
}
// _SEND
{