mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
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:
parent
13b68e1a61
commit
276cd66ccb
4 changed files with 50 additions and 15 deletions
|
@ -1117,7 +1117,7 @@ dummy_func(
|
|||
};
|
||||
|
||||
specializing op(_SPECIALIZE_SEND, (counter/1, receiver, unused -- receiver, unused)) {
|
||||
#if ENABLE_SPECIALIZATION
|
||||
#if ENABLE_SPECIALIZATION_FT
|
||||
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
|
||||
next_instr = this_instr;
|
||||
_Py_Specialize_Send(receiver, next_instr);
|
||||
|
@ -1125,7 +1125,7 @@ dummy_func(
|
|||
}
|
||||
OPCODE_DEFERRED_INC(SEND);
|
||||
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
|
||||
#endif /* ENABLE_SPECIALIZATION */
|
||||
#endif /* ENABLE_SPECIALIZATION_FT */
|
||||
}
|
||||
|
||||
op(_SEND, (receiver, v -- receiver, retval)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue