diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-05 04:40:52 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-05 04:40:52 +0000 |
commit | 4215d864c0baf21a4f67ed3fe44e642b84708197 (patch) | |
tree | 73adca0e1fd7fd30a0a1977e88fd14b3233b5cbb /externals/grill/flext | |
parent | 69f7f0c33559cf90e7d6ce7c0ddbd5501af7b1de (diff) |
""
svn path=/trunk/; revision=453
Diffstat (limited to 'externals/grill/flext')
-rw-r--r-- | externals/grill/flext/flext.dsp | 58 | ||||
-rw-r--r-- | externals/grill/flext/readme.txt | 2 | ||||
-rw-r--r-- | externals/grill/flext/source/flext.cpp | 1 | ||||
-rwxr-xr-x | externals/grill/flext/source/fllib.cpp | 2 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.cpp | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 19 | ||||
-rw-r--r-- | externals/grill/flext/source/flthr.cpp | 6 | ||||
-rw-r--r-- | externals/grill/flext/source/flutil.cpp | 14 |
8 files changed, 99 insertions, 7 deletions
diff --git a/externals/grill/flext/flext.dsp b/externals/grill/flext/flext.dsp index f094ea78..c2bc11af 100644 --- a/externals/grill/flext/flext.dsp +++ b/externals/grill/flext/flext.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=flext - Win32 Threads Debug +CFG=flext - Win32 Threads DLL Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE @@ -13,7 +13,7 @@ CFG=flext - Win32 Threads Debug !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE -!MESSAGE NMAKE /f "flext.mak" CFG="flext - Win32 Threads Debug" +!MESSAGE NMAKE /f "flext.mak" CFG="flext - Win32 Threads DLL Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE @@ -21,6 +21,8 @@ CFG=flext - Win32 Threads Debug !MESSAGE "flext - Win32 Debug" (basierend auf "Win32 (x86) Static Library") !MESSAGE "flext - Win32 Threads Debug" (basierend auf "Win32 (x86) Static Library") !MESSAGE "flext - Win32 Threads Release" (basierend auf "Win32 (x86) Static Library") +!MESSAGE "flext - Win32 Threads DLL Debug" (basierend auf "Win32 (x86) Static Library") +!MESSAGE "flext - Win32 Threads DLL Release" (basierend auf "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -43,7 +45,7 @@ RSC=rc.exe # PROP Intermediate_Dir "pd-msvc\s" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /YX"flext.h" /FD /c +# ADD CPP /nologo /GB /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /YX"flext.h" /FD /c # ADD BASE RSC /l 0xc07 /d "NDEBUG" # ADD RSC /l 0xc07 /d "NDEBUG" BSC32=bscmake.exe @@ -112,7 +114,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "pd-msvc\t" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c +# ADD CPP /nologo /GB /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c # ADD BASE RSC /l 0xc07 /d "NDEBUG" # ADD RSC /l 0xc07 /d "NDEBUG" BSC32=bscmake.exe @@ -122,6 +124,52 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"msvc/flext-pdwin.lib" # ADD LIB32 /nologo /out:"pd-msvc/flext_t-pdwin.lib" +!ELSEIF "$(CFG)" == "flext - Win32 Threads DLL Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "flext___Win32_Threads_DLL_Debug" +# PROP BASE Intermediate_Dir "flext___Win32_Threads_DLL_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "pd-msvc\tdl" +# PROP Intermediate_Dir "pd-msvc\tdl" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /FR /YX"flext.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /FR /YX"flext.h" /FD /GZ /c +# ADD BASE RSC /l 0xc07 /d "_DEBUG" +# ADD RSC /l 0xc07 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"pd-msvc/flext_td-pdwin.lib" +# ADD LIB32 /nologo /out:"pd-msvc/flext_tdl-pdwin.lib" + +!ELSEIF "$(CFG)" == "flext - Win32 Threads DLL Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "flext___Win32_Threads_DLL_Release" +# PROP BASE Intermediate_Dir "flext___Win32_Threads_DLL_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pd-msvc\trl" +# PROP Intermediate_Dir "pd-msvc\trl" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /GB /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c +# ADD CPP /nologo /GB /MD /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c +# ADD BASE RSC /l 0xc07 /d "NDEBUG" +# ADD RSC /l 0xc07 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"pd-msvc/flext_t-pdwin.lib" +# ADD LIB32 /nologo /out:"pd-msvc/flext_tl-pdwin.lib" + !ENDIF # Begin Target @@ -130,6 +178,8 @@ LIB32=link.exe -lib # Name "flext - Win32 Debug" # Name "flext - Win32 Threads Debug" # Name "flext - Win32 Threads Release" +# Name "flext - Win32 Threads DLL Debug" +# Name "flext - Win32 Threads DLL Release" # Begin Group "doc" # PROP Default_Filter "" diff --git a/externals/grill/flext/readme.txt b/externals/grill/flext/readme.txt index 20e62f61..8389cac7 100644 --- a/externals/grill/flext/readme.txt +++ b/externals/grill/flext/readme.txt @@ -118,6 +118,8 @@ Version history: - added forgotten flext_base::ToQueueString method - added timer functions and flext::Timer class - added functions for SIMD support +- fixed race condition when using LaunchThread in a setup function (now waiting for thread helper to initialize) +- added flext::Forward function to send messages to bound symbols 0.4.2: - started port for jMax diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp index e1a11179..8fe07f89 100644 --- a/externals/grill/flext/source/flext.cpp +++ b/externals/grill/flext/source/flext.cpp @@ -169,7 +169,6 @@ void flext_base::Setup(t_classid id) #ifdef FLEXT_THREADS thrid = GetThreadId(); - StartHelper(); #endif } diff --git a/externals/grill/flext/source/fllib.cpp b/externals/grill/flext/source/fllib.cpp index f061c2cb..54c5f60f 100755 --- a/externals/grill/flext/source/fllib.cpp +++ b/externals/grill/flext/source/fllib.cpp @@ -191,6 +191,8 @@ t_class *flext_obj::getClass(t_classid id) { return reinterpret_cast<libobject * void flext_obj::lib_init(const char *name,void setupfun(),bool attr) { + flext::Setup(); + #if FLEXT_SYS == FLEXT_SYS_MAX lib_name = MakeSymbol(name); ::setup( diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index 05dac9ba..dcac4c75 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -55,6 +55,10 @@ void flext::Setup() sym_pointer = fts_s_pointer; #else #endif + +#ifdef FLEXT_THREADS + StartHelper(); +#endif } diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 1963e56c..760083a8 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -505,9 +505,26 @@ public: const t_symbol *hdr; }; + //! @} FLEXT_S_ATOM +// --- messages ------------------------------------------------------- + + /*! \defgroup FLEXT_S_MSG Flext message handling + @{ + */ + + //! Send a message to a symbol (bound to an object) + static bool Forward(const t_symbol *s,int argc,const t_atom *argv); + + static bool Forward(const t_symbol *s,AtomList &args) { return Forward(s,args.Count(),args.Atoms()); } + static bool Forward(const char *s,AtomList &args) { return Forward(MakeSymbol(s),args.Count(),args.Atoms()); } + +//! @} FLEXT_S_MSG + + + // --- thread stuff ----------------------------------------------- #ifdef FLEXT_THREADS @@ -804,7 +821,7 @@ public: /*! \brief Launch a thread \remark thr_params *p may be NULL if not needed */ - static bool LaunchThread(void (*meth)(thr_params *p),thr_params *p); + static bool LaunchThread(void (*meth)(thr_params *p),thr_params *p = NULL); //! @} FLEXT_S_THREAD diff --git a/externals/grill/flext/source/flthr.cpp b/externals/grill/flext/source/flthr.cpp index 9ad4d75f..d2430041 100644 --- a/externals/grill/flext/source/flthr.cpp +++ b/externals/grill/flext/source/flthr.cpp @@ -65,6 +65,12 @@ bool flext::StartHelper() #endif if(!ok) error("flext - Could not launch helper thread!"); + else { + // now we have to wait for thread helper to initialize + while(!thrhelpid || !thrhelpcond) Sleep(0.001); + + // we are reading for threading now! + } return ok; } diff --git a/externals/grill/flext/source/flutil.cpp b/externals/grill/flext/source/flutil.cpp index f1035359..09c75377 100644 --- a/externals/grill/flext/source/flutil.cpp +++ b/externals/grill/flext/source/flutil.cpp @@ -26,4 +26,16 @@ void flext::ZeroMem(void *dst,int bytes) } - +bool flext::Forward(const t_symbol *recv,int argc,const t_atom *argv) +{ + t_class **cl = (t_class **)recv->s_thing; + if(!cl) return false; + +#if FLEXT_SYS == FLEXT_SYS_PD + pd_forwardmess(cl,argc,(t_atom *)argv); +#else + #error Not implemented +#endif + + return true; +} |