Blender V5.0
bpy_threads.cc File Reference
#include <Python.h>
#include "python_compat.hh"
#include "../BPY_extern.hh"

Go to the source code of this file.

Functions

BPy_ThreadStatePtr BPY_thread_save ()
void BPY_thread_restore (BPy_ThreadStatePtr tstate)
void BPY_thread_backtrace_print ()

Detailed Description

This file contains wrapper functions related to global interpreter lock. these functions are slightly different from the original Python API, don't throw SIGABRT even if the thread state is nullptr.

Definition in file bpy_threads.cc.

Function Documentation

◆ BPY_thread_backtrace_print()

void BPY_thread_backtrace_print ( )

Print the Python backtrace of the current thread state.

Should be safe to call from anywhere at any point, may not output anything if there is no valid python thread state available.

Definition at line 38 of file bpy_threads.cc.

References printf, and Py_DECREF().

◆ BPY_thread_restore()

void BPY_thread_restore ( BPy_ThreadStatePtr tstate)

Analogue of #PyEval_RestoreThread()

Definition at line 31 of file bpy_threads.cc.

◆ BPY_thread_save()

BPy_ThreadStatePtr BPY_thread_save ( )
nodiscard

Analogue of #PyEval_SaveThread()

Definition at line 18 of file bpy_threads.cc.

References PyThreadState_GetUnchecked.