Skip to content

Commit

Permalink
Debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Aug 16, 2023
1 parent 46ac7b5 commit 8906370
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/mrc/_pymrc/src/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,22 @@ std::function<void()> create_gil_initializer()
std::function<void()> create_gil_finalizer()
{
bool python_finalizing = _Py_IsFinalizing() != 0;
LOG(INFO) << "create_gil_finalizer - finalizing: " << std::boolalpha << python_finalizing;

if (python_finalizing)
{
// If python if finalizing, dont worry about thread state
// If python is finalizing, dont worry about thread state
return nullptr;
}

// Ensure we dont have the GIL here otherwise this deadlocks.
return [] {
bool python_finalizing = _Py_IsFinalizing() != 0;
LOG(INFO) << "gil_finalizer - finalizing: " << std::boolalpha << python_finalizing;

if (python_finalizing)
{
// If python if finalizing, dont worry about thread state
// If python is finalizing, dont worry about thread state
return;
}

Expand Down

0 comments on commit 8906370

Please sign in to comment.