ext/pycall/pycall_internal.h in pycall-1.0.3 vs ext/pycall/pycall_internal.h in pycall-1.1.0.rc1
- old
+ new
@@ -8,10 +8,11 @@
#endif
#endif
#include <ruby.h>
#include <ruby/encoding.h>
+#include <ruby/thread.h>
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
#if SIZEOF_LONG == SIZEOF_VOIDP
@@ -32,11 +33,14 @@
return (FIXNUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == RUBY_T_BIGNUM));
}
#endif
void ruby_debug_breakpoint();
+int ruby_thread_has_gvl_p(void);
+#define CALL_WITH_GVL(func, data) rb_thread_call_with_gvl((void * (*)(void *))(func), (void *)(data))
+
/* ==== python ==== */
typedef intptr_t Py_intptr_t;
#ifdef HAVE_SSIZE_T
@@ -579,16 +583,20 @@
PyObject * (* PySlice_New)(PyObject *, PyObject *, PyObject *);
PyObject * (* PyIter_Next)(PyObject *);
+ int (* PyEval_ThreadsInitialized)(void);
+ void (* PyEval_InitThreads)(void);
+
PyObject * (* PyErr_Occurred)(void);
void (* PyErr_Fetch)(PyObject **, PyObject **, PyObject **);
void (* PyErr_Restore)(PyObject *, PyObject *, PyObject *);
void (* PyErr_Clear)(void);
void (* PyErr_SetString)(PyObject *, const char *); /* decoded from utf-8 */
void (* PyErr_Format)(PyObject *, const char *, ...); /* ASCII-encoded string */
+ void (* PyErr_SetInterrupt)(void);
PyObject * (* PyImport_ImportModule)(char const*);
PyObject * (* PyImport_ImportModuleLevel)(char const*, PyObject *, PyObject *, PyObject *, int);
void (* PyOS_AfterFork)(void);
@@ -635,10 +643,9 @@
VALUE pycall_import_module(char const *name);
VALUE pycall_import_module_level(char const *name, VALUE globals, VALUE locals, VALUE fromlist, int level);
VALUE pycall_getattr_default(VALUE pyobj, char const *name, VALUE default_value);
VALUE pycall_getattr(VALUE pyobj, char const *name);
-VALUE pycall_pyobject_to_ruby(PyObject *);
VALUE pycall_pytype_to_ruby(PyObject *);
VALUE pycall_pymodule_to_ruby(PyObject *);
VALUE pycall_pybool_to_ruby(PyObject *);
VALUE pycall_pycomplex_to_ruby(PyObject *);
VALUE pycall_pyfloat_to_ruby(PyObject *);