#include <Container_init_python.hxx>
#include <cStringIO.h>
-#include <qmutex.h>
-
#include <utilities.h>
//#endif
-static QMutex myMutex(true);
-
-
PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState):
myThreadState(theThreadState),
mySaveThreadState(KERNEL_PYTHON::_gtstate)
}
-ThreadLock::ThreadLock(QMutex* theMutex, const char* theComment):
- myMutex(theMutex),
- myComment(theComment)
-{
-// if(MYDEBUG && myComment != "") MESSAGE(" ThreadLock "<<this<<"::"<<myMutex<<" - "<<myComment<<" - "<<myMutex->locked());
- myMutex->lock();
-}
-
-
-ThreadLock::~ThreadLock(){
-// if(MYDEBUG && myComment != "") MESSAGE("~ThreadLock "<<this<<"::"<<myMutex<<" - "<<myComment);
- myMutex->unlock();
-}
-
-
-bool IsPyLocked(){
- return myMutex.locked();
-}
-
-
-ThreadLock GetPyThreadLock(const char* theComment){
- return ThreadLock(&myMutex,theComment);
-}
-
-
class PyReleaseLock{
public:
~PyReleaseLock(){
#include <Python.h> // must be before qt includes ...
-class QSemaphore;
-class QMutex;
-
extern "C" PyObject * PyEval_EvalCode(PyObject *co, PyObject *g, PyObject *l);
#define TOP_HISTORY_PY "--- top of history ---"
#define BEGIN_HISTORY_PY "--- begin of history ---"
-
-class SemaphoreLock{
- QSemaphore* mySemaphore;
- std::string myComment;
- public:
- SemaphoreLock(QSemaphore* theSemaphore, const char* theComment = "");
- ~SemaphoreLock();
-};
-
-
class PYINTERP_EXPORT PyLockWrapper
{
PyThreadState* myThreadState;
};
-class ThreadLock
-{
- QMutex* myMutex;
- std::string myComment;
-public:
- ThreadLock(QMutex* theMutex, const char* theComment = "");
- ~ThreadLock();
-};
-
-
-bool IsPyLocked();
-
-ThreadLock GetPyThreadLock(const char* theComment = "");
-
class PYINTERP_EXPORT PyInterp_base{
public:
-// static PyThreadState *_gtstate;
static int _argc;
static char* _argv[];
static PyObject *builtinmodule;