aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flout.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-12-05 05:36:32 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-12-05 05:36:32 +0000
commit60ee6bb60b11bbfbccf56f335c9c6213e6daa79d (patch)
tree99b0c72c60aeba5d1a0489aae9edd16f371d965c /externals/grill/flext/source/flout.cpp
parentbbd9d289d152f6ef085dec680f0b1611c29f0e32 (diff)
""
svn path=/trunk/; revision=278
Diffstat (limited to 'externals/grill/flext/source/flout.cpp')
-rw-r--r--externals/grill/flext/source/flout.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/externals/grill/flext/source/flout.cpp b/externals/grill/flext/source/flout.cpp
index db225bd5..16a6ea29 100644
--- a/externals/grill/flext/source/flout.cpp
+++ b/externals/grill/flext/source/flout.cpp
@@ -16,7 +16,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flinternal.h"
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
#define CRITON() short state = lockout_set(1)
#define CRITOFF() lockout_set(state)
#else
@@ -92,7 +92,7 @@ void flext_base::qmsg::Add(qmsg *o)
}
*/
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
void flext_base::YTick(flext_base *th)
{
clock_delay(th->yclk,0);
@@ -105,20 +105,21 @@ void flext_base::YTick(flext_base *th)
void flext_base::QTick(flext_base *th)
{
-#ifdef DEBUG
+#ifdef FLEXT_THREADS
+
+#ifdef FLEXT_DEBUG
if(!th->IsSystemThread()) {
error("flext - Queue tick called by wrong thread!");
return;
}
#endif
-#ifdef FLEXT_THREADS
th->qmutex.Lock();
#endif
while(th->qhead) {
qmsg *m = th->qhead;
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
short state = lockout_set(1);
#endif
@@ -129,12 +130,12 @@ void flext_base::QTick(flext_base *th)
case qmsg::tp_sym: th->ToOutSymbol(m->out,m->_sym); break;
case qmsg::tp_list: th->ToOutList(m->out,m->_list.argc,m->_list.argv); break;
case qmsg::tp_any: th->ToOutAnything(m->out,m->_any.s,m->_any.argc,m->_any.argv); break;
-#ifdef DEBUG
+#ifdef FLEXT_DEBUG
default: ERRINTERNAL();
#endif
}
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
lockout_set(state);
#endif
@@ -156,15 +157,16 @@ void flext_base::Queue(qmsg *m)
if(qtail) qtail->nxt = m;
else qhead = m;
qtail = m;
-#ifdef FLEXT_THREADS
- qmutex.Unlock();
-#endif
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
clock_delay(qclk,0);
-#elif defined(MAXMSP)
+#elif FLEXT_SYS == FLEXT_SYS_MAX
clock_delay(yclk,0);
#else
- #error "To implement!"
+#error
+#endif
+
+#ifdef FLEXT_THREADS
+ qmutex.Unlock();
#endif
}