aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/main.h
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-03-06 04:57:32 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-03-06 04:57:32 +0000
commit6946886c3c48b4df5a8c797a68814d0153bdea52 (patch)
treeb26fe82c10cf0b5ec03de35c2919d96b2cf7ae50 /externals/grill/py/source/main.h
parent5d776422e8726d887c9b93fede610e4cbc50179d (diff)
use new flext fifo
use lock count instead of message queuing to avoid py->py messaging deadlock svn path=/trunk/; revision=2599
Diffstat (limited to 'externals/grill/py/source/main.h')
-rw-r--r--externals/grill/py/source/main.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h
index e1ae64a4..cd1c3736 100644
--- a/externals/grill/py/source/main.h
+++ b/externals/grill/py/source/main.h
@@ -13,6 +13,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "pyprefix.h"
#include "pysymbol.h"
+#include <flcontainers.h>
#if FLEXT_OS == FLEXT_LINUX || FLEXT_OS == FLEXT_IRIX
#include <unistd.h>
@@ -28,25 +29,16 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define PY_STOP_TICK 10 // ms
-class Fifo
+
+class FifoEl
+ : public Fifo::Cell
{
-protected:
- struct FifoEl {
- PyObject *fun;
- PyObject *args;
- FifoEl *nxt;
- };
public:
- Fifo(): head(NULL),tail(NULL) {}
- ~Fifo();
-
- bool Push(PyObject *f,PyObject *a);
- bool Pop(PyObject *&f,PyObject *&a);
-
-protected:
- FifoEl *head,*tail;
+ void Set(PyObject *f,PyObject *a) { fun = f,args = a; }
+ PyObject *fun,*args;
};
+typedef PooledFifo<FifoEl> PyFifo;
class py:
public flext_base
@@ -141,7 +133,7 @@ private:
#ifdef FLEXT_THREADS
bool qucall(PyObject *fun,PyObject *args);
void threadworker();
- Fifo qufifo;
+ PyFifo qufifo;
ThrCond qucond;
static PyThreadState *FindThreadState();