Skip to content

Commit

Permalink
Improvements per PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Sep 5, 2023
1 parent fbab666 commit 7b39722
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions python/mrc/tests/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <pybind11/gil.h> // for gil_scoped_acquire
#include <pybind11/pybind11.h>

#include <array> // std::array needed for py::print
#include <sstream>
#include <stdexcept>

Expand All @@ -37,10 +36,8 @@ struct RequireGilInDestructor
{
~RequireGilInDestructor()
{
// Grab the GIL to print
// Grab the GIL
py::gil_scoped_acquire gil;

py::print("RequireGilInDestructor::~RequireGilInDestructor() - calling destructor");
}
};

Expand Down
4 changes: 1 addition & 3 deletions python/tests/test_gil_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
TLS = threading.local()


def test_gc_called_in_thread_finalizer():
def test_gil_thread_local_storage():
"""
Test to reproduce issue #362
No asserts needed if it doesn't segfault, then we're good
"""
mrc.logging.log("Building pipeline")

def source_gen():
mrc.logging.log("source_gen")
x = RequireGilInDestructor()
TLS.x = x
yield x
Expand Down

0 comments on commit 7b39722

Please sign in to comment.