We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 691241a commit 552f8b0Copy full SHA for 552f8b0
include/pybind11/detail/internals.h
@@ -740,8 +740,9 @@ class internals_pp_manager {
740
}
741
742
743
- // Assume the GIL is held here. May call back into Python.
744
- // Create the internals content.
+ // Assume the GIL is held here. May call back into Python. We cannot hold the lock with our
+ // mutex here. So there may be multiple threads creating the content at the same time. Only
745
+ // one will install its content to pp below. Others will be freed when going out of scope.
746
auto tmp = std::unique_ptr<InternalsType>(new InternalsType());
747
748
{
0 commit comments