From f25cb430026b01219984364bb991948418909b77 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 6 Dec 2005 21:52:26 +0000 Subject: fixed and cleaned up library related stuff, especially co-existance of Max message and DSP library objects fixes for pthreads version 2 more pthreads V2 fixes updated docs update docs updates for OSX svn path=/trunk/; revision=4155 --- externals/grill/flext/source/flqueue.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'externals/grill/flext/source/flqueue.cpp') diff --git a/externals/grill/flext/source/flqueue.cpp b/externals/grill/flext/source/flqueue.cpp index a9077230..a83aa01e 100755 --- a/externals/grill/flext/source/flqueue.cpp +++ b/externals/grill/flext/source/flqueue.cpp @@ -23,9 +23,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. #ifdef FLEXT_THREADS //! Thread id of message queue thread -flext::thrid_t flext::thrmsgid = 0; +flext::thrid_t flext::thrmsgid; #endif +static bool qustarted = false; + #ifdef FLEXT_SHARED /* For the shared version it _should_ be possible to have only one queue for all externals. @@ -299,6 +301,7 @@ static void Trigger() void flext_base::QWorker(thr_params *) { thrmsgid = GetThreadId(); + qustarted = true; for(;;) { qthrcond.Wait(); QWork(true); @@ -308,19 +311,19 @@ void flext_base::QWorker(thr_params *) void flext_base::StartQueue() { - static bool started = false; - if(started) return; - else started = true; - + if(qustarted) return; #if FLEXT_QMODE == 1 #ifdef PERMANENTIDLE sys_callback(QTick,NULL,0); + qustarted = true; #endif #elif FLEXT_QMODE == 2 LaunchThread(QWorker,NULL); + while(!qustarted) Sleep(0.001); #elif FLEXT_QMODE == 0 && (FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX) // qclk = (t_qelem *)(qelem_new(NULL,(t_method)QTick)); qclk = (t_clock *)(clock_new(NULL,(t_method)QTick)); + qustarted = true; #else #error Not implemented! #endif -- cgit v1.2.1