| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + Fix a deadlock in the :term:`free threaded <free threading>` build when | ||
| 2 | + setting ``__abstractmethods__`` on a type while another thread holds the | ||
| 3 | + type lock. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1706,14 +1706,17 @@ type_set_abstractmethods(PyObject *tp, PyObject *value, void *Py_UNUSED(closure) | |||
| 1706 | 1706 | return -1; | |
| 1707 | 1707 | } | |
| 1708 | 1708 | ||
| 1709 | + pinned_mutexes_t pinned; | ||
| 1709 | 1710 | BEGIN_TYPE_LOCK(); | |
| 1710 | 1711 | _PyType_Modified_Unlocked(type); | |
| 1712 | + type_lock_prevent_release(&pinned); | ||
| 1711 | 1713 | types_stop_world(); | |
| 1712 | 1714 | if (abstract) | |
| 1713 | 1715 | type_add_flags(type, Py_TPFLAGS_IS_ABSTRACT); | |
| 1714 | 1716 | else | |
| 1715 | 1717 | type_clear_flags(type, Py_TPFLAGS_IS_ABSTRACT); | |
| 1716 | 1718 | types_start_world(); | |
| 1719 | + type_lock_allow_release(&pinned); | ||
| 1717 | 1720 | ASSERT_TYPE_LOCK_HELD(); | |
| 1718 | 1721 | END_TYPE_LOCK(); | |
| 1719 | 1722 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments