From 392f24a84a7ca535a7132cfe0a8da55aa28733ce Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 30 Jan 2003 04:36:06 +0000 Subject: "" svn path=/trunk/; revision=366 --- externals/grill/flext/source/fldsp.cpp | 3 +-- externals/grill/flext/source/flprefix.h | 1 - externals/grill/flext/source/flsupport.h | 20 +++++++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'externals/grill/flext/source') diff --git a/externals/grill/flext/source/fldsp.cpp b/externals/grill/flext/source/fldsp.cpp index 13eab25d..f6270261 100644 --- a/externals/grill/flext/source/fldsp.cpp +++ b/externals/grill/flext/source/fldsp.cpp @@ -186,8 +186,7 @@ void flext_dsp::m_dsp(int /*n*/,t_signalvec const * /*insigs*/,t_signalvec const void flext_dsp::m_signal(int n,t_sample *const * /*insigs*/,t_sample *const *outs) { - for(int i = 0; i < CntOutSig(); ++i) - memset(outs[i],0,n*sizeof(*outs[i])); + for(int i = 0; i < CntOutSig(); ++i) ZeroMem(outs[i],n*sizeof(*outs[i])); } #if FLEXT_SYS != FLEXT_SYS_MAX diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h index f12d1320..51c88096 100755 --- a/externals/grill/flext/source/flprefix.h +++ b/externals/grill/flext/source/flprefix.h @@ -211,7 +211,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #endif - #if FLEXT_OS == FLEXT_OS_WIN // #pragma message("Compiling for Windows") diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 3f771ea0..e2350d04 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -16,6 +16,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #define __FLSUPPORT_H #include "flstdc.h" +#include class FLEXT_SHARE flext_base; @@ -729,11 +730,24 @@ public: } /*! \brief Wait for condition (for a certain time) - \param time Wait time in seconds + \param ftime Wait time in seconds + \ret 0 = signalled, 1 = timed out + \remark Depending on the implementation ftime may not be fractional. + \remark So if ftime = 0 this may suck away your cpu if used in a signalled loop. */ - bool TimedWait(float time) + bool TimedWait(float ftime) { - timespec tm; tm.tv_sec = (long)time; tm.tv_nsec = (long)((time-(long)time)*1.e9); + timespec tm; +#if 0 // find out when the following is defined + clock_gettime(CLOCK_REALTIME,tm); + tm.tv_nsec += (long)((ftime-(long)ftime)*1.e9); + long nns = tm.tv_nsec%1000000000; + tm.tv_sec += (long)ftime+(tm.tv_nsec-nns)/1000000000; + tm.tv_nsec = nns; +#else + tm.tv_sec = time(NULL)+(long)ftime; + tm.tv_nsec = 0; +#endif Lock(); bool ret = pthread_cond_timedwait(&cond,&mutex,&tm) == 0; Unlock(); -- cgit v1.2.1