Skip to content

Commit c1a323e

Browse files
committed
fix: move to correct spot
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 4db3dba commit c1a323e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

docs/advanced/misc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ However, the module is no longer free-threading safe, for the same reason as
299299
before, because the calculation is not synchronized. We can synchronize it
300300
using a Python critical section. This will do nothing if not in free-threaded
301301
Python. You can have it lock one or two Python objects. You cannot nest it.
302+
(Note: In Python 3.13t, Python re-locks if you enter a critical section again,
303+
which happens in various places. This was optimized away in 3.14+. Use a
304+
``std::mutex`` instead if this is a problem).
302305

303306
.. code-block:: cpp
304307
:emphasize-lines: 1,4,8

tests/test_embed/test_interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ TEST_CASE("Threads") {
369369
# else
370370
py::scoped_critical_section lock(locals);
371371
# endif
372-
locals["count"] = locals["count"].cast<int>() + 1;
373372
#endif
373+
locals["count"] = locals["count"].cast<int>() + 1;
374374
});
375375
}
376376

0 commit comments

Comments
 (0)