diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-17 04:36:31 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-17 04:36:31 +0000 |
commit | a5b45e8e2e99686ea73fa2793d7fec84f0d1a3ed (patch) | |
tree | 4b31406382bacd13aa784ea22d584ac634f8d8ad /externals/grill/flext/source/flclass.h | |
parent | a0cb0bd2e02740e50ec16dde2fb4e07f1702d1d0 (diff) |
""
svn path=/trunk/; revision=303
Diffstat (limited to 'externals/grill/flext/source/flclass.h')
-rw-r--r-- | externals/grill/flext/source/flclass.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h index 6f74b5fe..66da8e7a 100644 --- a/externals/grill/flext/source/flclass.h +++ b/externals/grill/flext/source/flclass.h @@ -392,37 +392,8 @@ public: @{ */ - /*! \brief Check if current thread should terminate - \todo Check for currently running thread - */ - bool ShouldExit() const { return shouldexit; } - - //! Check if current thread is the realtime system's thread - bool IsSystemThread() const { pthread_t cur = pthread_self(); return pthread_equal(cur,thrid) != 0; } - - /*! \brief Yield to other threads - \remark A call to this is only needed for systems with cooperative multitasking like MacOS<=9 - */ - static void ThrYield() { sched_yield(); } - - typedef pthread_t thrid_t; - - /*! \brief Get current thread id - */ - static thrid_t GetThreadId(); - - /*! \brief Increase/Decrease priority of a thread - */ - static bool ChangePriority(int dp,thrid_t thr = GetThreadId()); - - /*! \brief Get priority of a thread - */ - static int GetPriority(thrid_t thr = GetThreadId()); - - /*! \brief Set priority of a thread - */ - static bool SetPriority(int p,thrid_t thr = GetThreadId()); - + //! Check if current thread should terminate + bool ShouldExit() const; #endif // FLEXT_THREADS @@ -467,12 +438,12 @@ protected: class thr_entry { public: - thr_entry(flext_base *t,void *(*m)(thr_params *),thr_params *p,pthread_t id = pthread_self()): th(t),meth(m),params(p),thrid(id),active(false),nxt(NULL) {} + thr_entry(flext_base *t,void *(*m)(thr_params *),thr_params *p,pthread_t id = pthread_self()); //! \brief Check if this class represents the current thread bool Is(pthread_t id = pthread_self()) const { return pthread_equal(thrid,id) != 0; } - bool active; + bool active,shouldexit; pthread_t thrid; void *(*meth)(thr_params *); thr_params *params; @@ -660,10 +631,6 @@ private: static bool cb_SetAttrib(flext_base *c,const t_symbol *s,int argc,const t_atom *argv) { return c->SetAttrib(s,argc,argv); } #ifdef FLEXT_THREADS - bool shouldexit; - int thrcount; - - static pthread_t thrid; // the thread that created the object (the system thread) ThrMutex qmutex; static thr_entry *thrhead,*thrtail; |