Skip to content

Commit

Permalink
Optimized single thread path py_loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Jul 25, 2024
1 parent b2a871d commit 25178e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/loaders/py_loader/source/py_loader_threading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ thread_local py_thread_state *current_thread_state = NULL;

void py_loader_thread_initialize()
{
main_thread_state = PyEval_SaveThread();
main_thread_id = thread_id_get_current();
main_thread_ref_count = 0;
}
Expand Down Expand Up @@ -93,11 +92,11 @@ void py_loader_thread_release()
if (ref_count > 0)
{
ref_count = --main_thread_ref_count;
}

if (ref_count == 0)
{
main_thread_state = PyEval_SaveThread();
}
if (ref_count == 0)
{
main_thread_state = PyEval_SaveThread();
}
}
else
Expand Down

0 comments on commit 25178e7

Please sign in to comment.