Changed (again) how the GIL is aquired and the tstate restored. This

time it's simpler, better, and handles the case where there is a wx
calback/event while the GIL has been released by a non-wxPython
extension module.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-03-24 23:09:59 +00:00
parent 70a4ef826f
commit da32eb53cb
31 changed files with 494 additions and 459 deletions

View File

@@ -178,11 +178,11 @@ public:
"Get() -> (width,height)",
"Returns the width and height properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return tup;
}
}
@@ -251,11 +251,11 @@ public:
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
PyObject* Get() {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return tup;
}
}
@@ -364,11 +364,11 @@ public:
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
PyObject* Get() {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return tup;
}
}
@@ -532,13 +532,13 @@ public:
"Get() -> (x,y,width,height)",
"Return the rectangle properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return tup;
}
}
@@ -576,10 +576,10 @@ DocAStr(wxIntersectRect,
dest = reg1.GetBox();
if (dest != wxRect(0,0,0,0)) {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
wxRect* newRect = new wxRect(dest);
obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True);
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return obj;
}
Py_INCREF(Py_None);
@@ -663,11 +663,11 @@ public:
"Get() -> (x,y)",
"Return x and y properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y));
wxPyEndBlockThreads();
wxPyEndBlockThreads(blocked);
return tup;
}
}