aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flext.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-12-15 04:35:27 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-12-15 04:35:27 +0000
commita0cb0bd2e02740e50ec16dde2fb4e07f1702d1d0 (patch)
tree8647f172ee53287e3c9e24c127628a97deb0f761 /externals/grill/flext/source/flext.cpp
parent5bfb9859c430f83c39628217e19883bed23158ea (diff)
""
svn path=/trunk/; revision=302
Diffstat (limited to 'externals/grill/flext/source/flext.cpp')
-rw-r--r--externals/grill/flext/source/flext.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp
index dedf7c49..d0fdb766 100644
--- a/externals/grill/flext/source/flext.cpp
+++ b/externals/grill/flext/source/flext.cpp
@@ -130,10 +130,8 @@ flext_base::flext_base():
LOG1("%s - flext logging is on",thisName());
#ifdef FLEXT_THREADS
- thrid = pthread_self();
-
shouldexit = false;
- thrhead = thrtail = NULL;
+// thrhead = thrtail = NULL;
#endif
qhead = qtail = NULL;
qclk = (t_qelem *)(qelem_new(this,(t_method)QTick));
@@ -147,26 +145,7 @@ flext_base::flext_base():
flext_base::~flext_base()
{
#ifdef FLEXT_THREADS
- // wait for thread termination
- shouldexit = true;
- for(int wi = 0; thrhead && wi < 100; ++wi) Sleep(0.01f);
-
-//#ifdef _POSIX_THREADS
- qmutex.Lock(); // Lock message queue
- tlmutex.Lock();
- // timeout -> hard termination
- while(thrhead) {
- thr_entry *t = thrhead;
- if(pthread_cancel(t->thrid)) post("%s - Thread could not be terminated!",thisName());
- thrhead = t->nxt;
- t->nxt = NULL; delete t;
- }
- tlmutex.Unlock();
- qmutex.Unlock();
-//#else
-//#pragma message ("No tread cancelling")
-//#endif
-
+ TermThreads();
#endif
// send remaining pending messages
@@ -482,6 +461,12 @@ void flext_base::Setup(t_class *c)
ADD_IN_FT(7);
ADD_IN_FT(8);
ADD_IN_FT(9);
+
+#ifdef FLEXT_THREADS
+ thrid = pthread_self();
+
+ StartHelper();
+#endif
}
void flext_base::cb_help(t_class *c) { thisObject(c)->m_help(); }