From a0cb0bd2e02740e50ec16dde2fb4e07f1702d1d0 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 15 Dec 2002 04:35:27 +0000 Subject: "" svn path=/trunk/; revision=302 --- externals/grill/flext/source/flclass.h | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'externals/grill/flext/source/flclass.h') diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h index 12efeb82..6f74b5fe 100644 --- a/externals/grill/flext/source/flclass.h +++ b/externals/grill/flext/source/flclass.h @@ -467,20 +467,19 @@ protected: class thr_entry { public: - thr_entry(pthread_t id = pthread_self()): thrid(id),nxt(NULL) {} + 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) {} //! \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; pthread_t thrid; + void *(*meth)(thr_params *); + thr_params *params; + flext_base *th; thr_entry *nxt; }; - /*! \brief Start a method thread - \internal - */ - static bool StartThread(void *(*meth)(thr_params *p),thr_params *p,char *methname); - /*! \brief Add current thread to list of active threads \return true on success \internal @@ -491,6 +490,13 @@ protected: \internal */ void PopThread(); + +public: + /*! \brief Start a method thread + \internal + */ + bool StartThread(void *(*meth)(thr_params *p),thr_params *p,char *methname); + #endif protected: @@ -657,11 +663,18 @@ private: bool shouldexit; int thrcount; - pthread_t thrid; // the thread that created the object (the system thread) + static pthread_t thrid; // the thread that created the object (the system thread) ThrMutex qmutex; - thr_entry *thrhead,*thrtail; - ThrMutex tlmutex; + static thr_entry *thrhead,*thrtail; + static ThrMutex tlmutex; + + static pthread_t thrhelpid; + static bool StartHelper(); + static bool StopHelper(); + static void ThrHelper(void *); + + void TermThreads(); #endif class qmsg; -- cgit v1.2.1