From 03f3505e5a8493aa90c1f55396731a530b008205 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Thu, 3 Apr 2025 00:04:07 +0900 Subject: [PATCH] gh-131544: Update docs for PyType_AddWatcher (gh-132015) (cherry picked from commit 25275bda790e8a689092e83855d6d0574f26061b) Co-authored-by: Donghee Na --- Doc/c-api/type.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 4ba3f7ac2fafa48..be87b689fa1c22b 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -82,6 +82,9 @@ Type Objects error (e.g. no more watcher IDs available), return ``-1`` and set an exception. + In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, + so it must be called at start up (before spawning the first thread). + .. versionadded:: 3.12