more threads code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7930 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8839f3dfb0
commit
e052b32f9f
3 changed files with 15 additions and 23 deletions
|
|
@ -363,13 +363,10 @@ PySwigObject_type(void) {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyTypeObject pyswigobject_type
|
static PyTypeObject pyswigobject_type;
|
||||||
#if !defined(__cplusplus)
|
|
||||||
;
|
|
||||||
static int type_init = 0;
|
static int type_init = 0;
|
||||||
if (!type_init) {
|
if (!type_init) {
|
||||||
const PyTypeObject tmp
|
const PyTypeObject tmp
|
||||||
#endif
|
|
||||||
= {
|
= {
|
||||||
PyObject_HEAD_INIT(NULL)
|
PyObject_HEAD_INIT(NULL)
|
||||||
0, /* ob_size */
|
0, /* ob_size */
|
||||||
|
|
@ -426,16 +423,13 @@ PySwigObject_type(void) {
|
||||||
0,0,0,0 /* tp_alloc -> tp_next */
|
0,0,0,0 /* tp_alloc -> tp_next */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#if !defined(__cplusplus)
|
|
||||||
pyswigobject_type = tmp;
|
pyswigobject_type = tmp;
|
||||||
|
pyswigobject_type.ob_type = &PyType_Type;
|
||||||
type_init = 1;
|
type_init = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
pyswigobject_type.ob_type = &PyType_Type;
|
|
||||||
return &pyswigobject_type;
|
return &pyswigobject_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGRUNTIME PyObject *
|
SWIGRUNTIME PyObject *
|
||||||
PySwigObject_New(void *ptr, swig_type_info *ty, int own)
|
PySwigObject_New(void *ptr, swig_type_info *ty, int own)
|
||||||
{
|
{
|
||||||
|
|
@ -526,15 +520,12 @@ PySwigPacked_dealloc(PyObject *v)
|
||||||
SWIGRUNTIME PyTypeObject*
|
SWIGRUNTIME PyTypeObject*
|
||||||
PySwigPacked_type(void) {
|
PySwigPacked_type(void) {
|
||||||
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
|
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
|
||||||
static PyTypeObject pyswigpacked_type
|
static PyTypeObject pyswigpacked_type;
|
||||||
#if !defined(__cplusplus)
|
|
||||||
;
|
|
||||||
static int type_init = 0;
|
static int type_init = 0;
|
||||||
if (!type_init) {
|
if (!type_init) {
|
||||||
PyTypeObject tmp
|
PyTypeObject tmp
|
||||||
#endif
|
|
||||||
= {
|
= {
|
||||||
PyObject_HEAD_INIT(&PyType_Type)
|
PyObject_HEAD_INIT(NULL)
|
||||||
0, /* ob_size */
|
0, /* ob_size */
|
||||||
(char *)"PySwigPacked", /* tp_name */
|
(char *)"PySwigPacked", /* tp_name */
|
||||||
sizeof(PySwigPacked), /* tp_basicsize */
|
sizeof(PySwigPacked), /* tp_basicsize */
|
||||||
|
|
@ -593,13 +584,13 @@ PySwigPacked_type(void) {
|
||||||
0,0,0,0 /* tp_alloc -> tp_next */
|
0,0,0,0 /* tp_alloc -> tp_next */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#if !defined(__cplusplus)
|
|
||||||
pyswigpacked_type = tmp;
|
pyswigpacked_type = tmp;
|
||||||
|
pyswigpacked_type.ob_type = &PyType_Type;
|
||||||
type_init = 1;
|
type_init = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return &pyswigpacked_type;
|
return &pyswigpacked_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIME PyObject *
|
SWIGRUNTIME PyObject *
|
||||||
PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
|
PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
|
||||||
{
|
{
|
||||||
|
|
@ -837,11 +828,11 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
return SWIG_Py_Void();
|
return SWIG_Py_Void();
|
||||||
} else if (!type) {
|
} else if (!type) {
|
||||||
|
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||||
if (!PyErr_Occurred()) {
|
if (!PyErr_Occurred()) {
|
||||||
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
|
||||||
PyErr_SetString(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
|
PyErr_SetString(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
|
||||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
|
||||||
}
|
}
|
||||||
|
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
||||||
|
|
@ -881,6 +872,7 @@ void *SWIG_ReturnGlobalTypeList(void *);
|
||||||
SWIGRUNTIME swig_module_info *
|
SWIGRUNTIME swig_module_info *
|
||||||
SWIG_Python_GetModule(void) {
|
SWIG_Python_GetModule(void) {
|
||||||
static void *type_pointer = (void *)0;
|
static void *type_pointer = (void *)0;
|
||||||
|
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||||
/* first check if module already created */
|
/* first check if module already created */
|
||||||
if (!type_pointer) {
|
if (!type_pointer) {
|
||||||
#ifdef SWIG_LINK_RUNTIME
|
#ifdef SWIG_LINK_RUNTIME
|
||||||
|
|
@ -894,6 +886,7 @@ SWIG_Python_GetModule(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||||
return (swig_module_info *) type_pointer;
|
return (swig_module_info *) type_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
#if !defined(SWIG_PYTHON_NO_THREADING)
|
#if defined(SWIG_PYTHON_NO_THREADING)
|
||||||
# if !defined(SWIG_PYTHON_THREADING)
|
|
||||||
# define SWIG_PYTHON_THREADING
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# if defined(SWIG_PYTHON_THREADING)
|
# if defined(SWIG_PYTHON_THREADING)
|
||||||
# undef SWIG_PYTHON_THREADING
|
# undef SWIG_PYTHON_THREADING
|
||||||
# endif
|
# endif
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,6 @@ public:
|
||||||
if (!threads) {
|
if (!threads) {
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Printf(f_init,"\n");
|
Printf(f_init,"\n");
|
||||||
Printf(f_init,"/* Initialize threading */\n");
|
Printf(f_init,"/* Initialize threading */\n");
|
||||||
Printf(f_init,"SWIG_PYTHON_INITIALIZE_THREADING;\n");
|
Printf(f_init,"SWIG_PYTHON_INITIALIZE_THREADING;\n");
|
||||||
|
|
@ -376,6 +375,10 @@ public:
|
||||||
Printf(f_runtime,"#define SWIG_DIRECTORS\n");
|
Printf(f_runtime,"#define SWIG_DIRECTORS\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (threads) {
|
||||||
|
Printf(f_runtime,"#define SWIG_PYTHON_THREADING\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* Set module name */
|
/* Set module name */
|
||||||
module = Copy(Getattr(n,"name"));
|
module = Copy(Getattr(n,"name"));
|
||||||
mainmodule = Getattr(n,"name");
|
mainmodule = Getattr(n,"name");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue