diff options
Diffstat (limited to 'externals/grill/py/source/main.h')
-rw-r--r-- | externals/grill/py/source/main.h | 24 |
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(); |