Fix the problem related to the coexistence of several python threads, reference: https://docs.python.org/2/c-api/init.html#thread-state-and-the-global-interpreter-lock