diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-06-07 14:40:19 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-06-07 14:40:19 +0000 |
commit | 6453bdb49bd08b3f8cec729f36fd75099e80a174 (patch) | |
tree | b5614301d06a5b9c4a1455492af30fe98d5fbbd2 /externals | |
parent | 0e0792d5b45037c5bd3202fe4de4e68f4e0886c5 (diff) |
cosmetic stuff
corrections to config build templates
digest one-element list messages as single atoms
made flext::Forward threadsafe
simplified message analysis
svn path=/trunk/; revision=3127
Diffstat (limited to 'externals')
-rw-r--r-- | externals/grill/flext/buildsys/mac/max/config-gcc.def | 3 | ||||
-rw-r--r-- | externals/grill/flext/buildsys/mac/pd/config-gcc.def | 3 | ||||
-rw-r--r-- | externals/grill/flext/source/fldefs_meththr.h | 8 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 28 | ||||
-rw-r--r-- | externals/grill/flext/source/flthr.cpp | 7 |
5 files changed, 27 insertions, 22 deletions
diff --git a/externals/grill/flext/buildsys/mac/max/config-gcc.def b/externals/grill/flext/buildsys/mac/max/config-gcc.def index 5ce580af..66a8b990 100644 --- a/externals/grill/flext/buildsys/mac/max/config-gcc.def +++ b/externals/grill/flext/buildsys/mac/max/config-gcc.def @@ -29,10 +29,11 @@ HELPPATH=/Applications/MaxMSP\ 4.5/max-help/flext # user defined compiler flags # (check if they match your system!) -UFLAGS=-maltivec -faltivec -ffast-math +UFLAGS=-faltivec -ffast-math # user defined optimization flags # (check if they match your system!) OFLAGS=-O3 # optimizations for G4 OFLAGS+=-mcpu=G4 + diff --git a/externals/grill/flext/buildsys/mac/pd/config-gcc.def b/externals/grill/flext/buildsys/mac/pd/config-gcc.def index 69112b92..925fdd9a 100644 --- a/externals/grill/flext/buildsys/mac/pd/config-gcc.def +++ b/externals/grill/flext/buildsys/mac/pd/config-gcc.def @@ -26,10 +26,11 @@ INSTPATH=$(PDPATH)/extra # user defined optimization flags # (check if they match your system!) -UFLAGS=-maltivec -faltivec -ffast-math +UFLAGS=-faltivec -ffast-math # user defined compiler flags # (check if they match your system!) OFLAGS=-O3 # optimizations for G4 OFLAGS+=-mcpu=G4 + diff --git a/externals/grill/flext/source/fldefs_meththr.h b/externals/grill/flext/source/fldefs_meththr.h index 7aa36ddf..f68aa507 100644 --- a/externals/grill/flext/source/fldefs_meththr.h +++ b/externals/grill/flext/source/fldefs_meththr.h @@ -49,7 +49,7 @@ static bool FLEXT_CALL_PRE(M_FUN)(flext_base *c,t_symbol *s,int argc,t_atom *arg static void FLEXT_THR_PRE(M_FUN)(thr_params *p) { \ thisType *th = FLEXT_CAST<thisType *>(p->cl); \ bool ok = th->PushThread(); \ - AtomAnything *args = p->var[0]._any.args; \ + AtomAnything *args = p->var[0]._any; \ delete p; \ if(ok) { \ th->M_FUN(args->Header(),args->Count(),args->Atoms()); \ @@ -67,7 +67,7 @@ static bool FLEXT_CALL_PRE(M_FUN)(flext_base *c,int argc,t_atom *argv) { \ static void FLEXT_THR_PRE(M_FUN)(thr_params *p) { \ thisType *th = FLEXT_CAST<thisType *>(p->cl); \ bool ok = th->PushThread(); \ - AtomList *args = p->var[0]._list.args; \ + AtomList *args = p->var[0]._list; \ delete p; \ if(ok) { \ th->M_FUN(args->Count(),args->Atoms()); \ @@ -81,13 +81,13 @@ static void FLEXT_THR_PRE(M_FUN)(thr_params *p) { \ */ #define FLEXT_THREAD_X(M_FUN) \ static bool FLEXT_CALL_PRE(M_FUN)(flext_base *c,void *data) { \ - thr_params *p = new thr_params; p->var[0]._ext.data = data; \ + thr_params *p = new thr_params; p->var[0]._ext = data; \ return c->StartThread(FLEXT_THR_PRE(M_FUN),p,#M_FUN); \ } \ static void FLEXT_THR_PRE(M_FUN)(thr_params *p) { \ thisType *th = FLEXT_CAST<thisType *>(p->cl); \ bool ok = th->PushThread(); \ - void *data = p->var[0]._ext.data; \ + void *data = p->var[0]._ext; \ delete p; \ if(ok) { \ th->M_FUN(data); \ diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 31fe91ff..3226b39e 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -781,11 +781,21 @@ public: //! @} FLEXT_S_LOCK -#ifdef FLEXT_THREADS /*! \defgroup FLEXT_S_THREAD Flext thread handling @{ */ + //! Check if current thread is the realtime system's thread + static bool IsSystemThread() { +#ifdef FLEXT_THREADS + return IsThread(GetSysThreadId()); +#else + return true; +#endif + } + +#ifdef FLEXT_THREADS + //! thread type #if FLEXT_THREADS == FLEXT_THR_MP typedef MPTaskID thrid_t; @@ -813,7 +823,7 @@ public: /*! \brief Get system thread id */ - static thrid_t GetSysThreadId(); + static thrid_t GetSysThreadId() { return thrid; } //! Check if current thread should terminate static bool ShouldExit(); @@ -829,9 +839,6 @@ public: #endif } - //! Check if current thread is the realtime system's thread - static bool IsSystemThread() { return IsThread(GetSysThreadId()); } - /*! \brief Thread parameters \internal @@ -852,9 +859,9 @@ public: float _float; int _int; t_symptr _t_symptr; - struct { AtomAnything *args; } _any; - struct { AtomList *args; } _list; - struct { void *data; } _ext; + AtomAnything *_any; + AtomList *_list; + void *_ext; } *var; }; @@ -1093,11 +1100,10 @@ public: */ static bool StopThread(void (*meth)(thr_params *p),thr_params *params = NULL,bool wait = false); -//! @} FLEXT_S_THREAD - - #endif // FLEXT_THREADS +//! @} FLEXT_S_THREAD + // --- timer stuff ----------------------------------------------- diff --git a/externals/grill/flext/source/flthr.cpp b/externals/grill/flext/source/flthr.cpp index f56ab096..fb2a28b5 100644 --- a/externals/grill/flext/source/flthr.cpp +++ b/externals/grill/flext/source/flthr.cpp @@ -104,9 +104,6 @@ static ThrFinder< TypedLifo<thr_entry> > thractive,thrstopped; static flext::ThrCond *thrhelpcond = NULL; -flext::thrid_t flext::GetSysThreadId() { return thrid; } - - static void LaunchHelper(thr_entry *e) { e->thrid = flext::GetThreadId(); @@ -601,8 +598,8 @@ bool flext::SetPriority(int p,thrid_t id) flext_base::thr_params::thr_params(int n): cl(NULL),var(new _data[n]) {} flext_base::thr_params::~thr_params() { if(var) delete[] var; } -void flext_base::thr_params::set_any(const t_symbol *s,int argc,const t_atom *argv) { var[0]._any.args = new AtomAnything(s,argc,argv); } -void flext_base::thr_params::set_list(int argc,const t_atom *argv) { var[0]._list.args = new AtomList(argc,argv); } +void flext_base::thr_params::set_any(const t_symbol *s,int argc,const t_atom *argv) { var[0]._any = new AtomAnything(s,argc,argv); } +void flext_base::thr_params::set_list(int argc,const t_atom *argv) { var[0]._list = new AtomList(argc,argv); } #if FLEXT_THREADS == FLEXT_THR_POSIX |