diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
commit | 0ed7a8b68dd73e2b0473b8127aeca99f3bac9061 (patch) | |
tree | 5c67818b38a5cc2f9caa5ca7f8640ca356adf02b /externals/grill/flext/tutorial/thread2 | |
parent | bb4c7f6a245394d09dac9adfb2efb093d3d98452 (diff) |
cleaned up grill externals - replaced with svn:externals to svn.grrrr.org/ext/trunk/
svn path=/trunk/; revision=10951
Diffstat (limited to 'externals/grill/flext/tutorial/thread2')
-rw-r--r-- | externals/grill/flext/tutorial/thread2/Makefile.am | 51 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/thread2/main.cpp | 134 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/thread2/package.txt | 3 | ||||
-rwxr-xr-x | externals/grill/flext/tutorial/thread2/thread2.mcp | bin | 148836 -> 0 bytes | |||
-rw-r--r-- | externals/grill/flext/tutorial/thread2/thread2.vcproj | 176 |
5 files changed, 0 insertions, 364 deletions
diff --git a/externals/grill/flext/tutorial/thread2/Makefile.am b/externals/grill/flext/tutorial/thread2/Makefile.am deleted file mode 100644 index 8b0e89da..00000000 --- a/externals/grill/flext/tutorial/thread2/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -# -# automake template -# added by tim blechmann -# - -NAME = thread2 - -BUILT_SOURCES = main.cpp - -EXTRA_DIST = main.cpp \ - $(NAME).mcp \ - $(NAME).vcproj - -CXXFLAGS = @CXXFLAGS@ \ - @OPT_FLAGS@ \ - @INCLUDEDIR@ \ - -I../../source \ - $(DEFS) \ - -DFLEXT_SHARED - -LDFLAGS = @DYNAMIC_LDFLAGS@ @LDFLAGS@ \ - $(patsubst %,-framework %,$(FRAMEWORKS)) - -LIBS = @LIBS@ -lflext-pd - -FRAMEWORKS = @FRAMEWORKS@ - -TARGETDIR = @TARGETDIR@ - -TARGET =$(NAME).@EXTENSION@ - -OBJECTS = $(patsubst %.cpp,./%.@OBJEXT@,$(BUILT_SOURCES)) - -SYSDIR = @SYSDIR@ - - -# ----------------------------- targets -------------------------------- - -all-local: $(OBJECTS) - $(CXX) $(LDFLAGS) ./*.@OBJEXT@ $(LIBS) -o ../$(TARGETDIR)/$(TARGET) - strip --strip-unneeded ../$(TARGETDIR)/$(TARGET) - -./%.@OBJEXT@ : %.cpp - $(CXX) -c $(CXXFLAGS) $< -o $@ - -clean-local: - rm -f ../$(TARGETDIR)/$(TARGET) - rm -f ./$(OBJECTS) - -install-exec-local: - install ../$(TARGET) $(SYSDIR)extra diff --git a/externals/grill/flext/tutorial/thread2/main.cpp b/externals/grill/flext/tutorial/thread2/main.cpp deleted file mode 100644 index 40e82b3c..00000000 --- a/externals/grill/flext/tutorial/thread2/main.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -flext tutorial - threads 2 - -Copyright (c) 2002,2003 Thomas Grill (xovo@gmx.net) -For information on usage and redistribution, and for a DISCLAIMER OF ALL -WARRANTIES, see the file, "license.txt," in this distribution. - -------------------------------------------------------------------------- - -This shows an example of multiple threads and syncing with a thread conditional -*/ - -/* define FLEXT_THREADS for thread usage. Flext must also have been compiled with that defined! - it's even better to define that as a compiler flag (-D FLEXT_THREADS) for all files of the - flext external -*/ -#ifndef FLEXT_THREADS -#define FLEXT_THREADS -#endif - -#include <flext.h> - -#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) -#error You need at least flext version 0.4.0 -#endif - - -class thread2: - public flext_base -{ - FLEXT_HEADER(thread2,flext_base) - -public: - thread2(int del); - -protected: - void m_start(int st); - void m_stop(); - void m_text(); - - void m_textout(); - -private: - FLEXT_THREAD_I(m_start) // define threaded callback for method m_start - FLEXT_CALLBACK(m_stop) // normal callback for m_stop - FLEXT_CALLBACK(m_text) // turn on console output - - FLEXT_THREAD(m_textout) // text output - - float delay; - volatile int count; - - // caution: CodeWarrior seems to ignore volatile modifier!! - volatile bool stopit,running,blipping; // flags for running and stopping - - // thread conditional for stop signal - ThrCond cond; -}; - -FLEXT_NEW_1("thread2",thread2,int) - - - -thread2::thread2(int del): - delay(del/1000.f), - stopit(false), - running(false),blipping(false) -{ - AddInAnything(); - AddOutInt(2); - - FLEXT_ADDMETHOD(0,m_start); // register start for integer numbers (floats in PD) - FLEXT_ADDMETHOD_(0,"text",m_text); // register m_text method for "text" tag - FLEXT_ADDMETHOD_(0,"stop",m_stop); // register m_text method for "stop" tag -} - -void thread2::m_start(int st) -{ - // if already running, just set back the counter - if(running) { count = st; return; } - - running = true; - - // loop until either the system exit flag or the "stopit" flag is set - for(count = st; !ShouldExit() && !stopit; ++count) - { - Sleep(delay); - ToOutInt(0,count); // output loop count - } - - running = false; // change state flag -// cond.Lock(); // lock conditional - cond.Signal(); // signal changed flag to waiting "stop" method -// cond.Unlock(); // unlock conditional -} - -void thread2::m_stop() -{ -// cond.Lock(); // lock conditional - stopit = true; // set termination flag - - while(*(&running) || *(&blipping)) // workaround for CodeWarrior (doesn't honor volatile modifier!) - { - cond.Wait(); // wait for signal by running threads - } - - // --- Here, the threads should have stopped --- - - stopit = false; // reset flag -// cond.Unlock(); // unlock conditional -} - - -void thread2::m_text() -{ - FLEXT_CALLMETHOD(m_textout); -} - -void thread2::m_textout() -{ - if(blipping) return; - blipping = true; - - while(!ShouldExit() && !stopit) { - post("%i",count); - Sleep(1.f); - } - - blipping = false; // change state flag -// cond.Lock(); // lock conditional - cond.Signal(); // signal changed flag to waiting "stop" method -// cond.Unlock(); // unlock conditional -} - diff --git a/externals/grill/flext/tutorial/thread2/package.txt b/externals/grill/flext/tutorial/thread2/package.txt deleted file mode 100644 index 5d7ae4e8..00000000 --- a/externals/grill/flext/tutorial/thread2/package.txt +++ /dev/null @@ -1,3 +0,0 @@ -NAME=thread2
-BUILDTYPE=multi
-SRCS=main.cpp
diff --git a/externals/grill/flext/tutorial/thread2/thread2.mcp b/externals/grill/flext/tutorial/thread2/thread2.mcp Binary files differdeleted file mode 100755 index 9d051153..00000000 --- a/externals/grill/flext/tutorial/thread2/thread2.mcp +++ /dev/null diff --git a/externals/grill/flext/tutorial/thread2/thread2.vcproj b/externals/grill/flext/tutorial/thread2/thread2.vcproj deleted file mode 100644 index 99a25bad..00000000 --- a/externals/grill/flext/tutorial/thread2/thread2.vcproj +++ /dev/null @@ -1,176 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="thread2" - SccProjectName="max/flext/tutorial/thread2" - SccAuxPath="" - SccLocalPath="." - SccProvider="MSSCCI:Jalindi Igloo"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\msvc" - IntermediateDirectory=".\msvc" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="c:\programme\audio\pd\src,..\..\source" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PD;FLEXT_THREADS" - StringPooling="TRUE" - RuntimeLibrary="0" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\msvc/thread2.pch" - AssemblerListingLocation=".\msvc/" - ObjectFile=".\msvc/" - ProgramDataBaseFileName=".\msvc/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="pd.lib flext_t-pdwin.lib pthreadVC.lib" - OutputFile="../pd-msvc/thread2.dll" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="C:\Programme\audio\pd\bin;..\..\pd-msvc" - ProgramDatabaseFile=".\msvc/thread2.pdb" - ImportLibrary=".\msvc/thread2.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\msvc/thread2.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="3079"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\msvc-debug" - IntermediateDirectory=".\msvc-debug" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="c:\programme\audio\pd\src,..\..\source" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FLEXT_THREADS" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\msvc-debug/thread2.pch" - AssemblerListingLocation=".\msvc-debug/" - ObjectFile=".\msvc-debug/" - ProgramDataBaseFileName=".\msvc-debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="4" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="pd.lib flext_td-pdwin.lib pthreadVC.lib" - OutputFile=".\msvc-debug/thread2.dll" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="c:\programme\audio\pd\bin;..\..\pd-msvc" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\msvc-debug/thread2.pdb" - ImportLibrary=".\msvc-debug/thread2.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\msvc-debug/thread2.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="3079"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="main.cpp"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;PD;FLEXT_THREADS;$(NoInherit)"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;PD;FLEXT_THREADS;$(NoInherit)" - BasicRuntimeChecks="3" - BrowseInformation="1"/> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> |