aboutsummaryrefslogtreecommitdiff
path: root/externals
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-02-01 04:57:06 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-02-01 04:57:06 +0000
commit5143f2e9971ce2aa33f58383dac62e7f16514f86 (patch)
tree6e26388d36e6a551257008d040476fcc32298190 /externals
parent526abae44574433902c8860c46a176a503491010 (diff)
fixes for single-threaded compilation
little restructuring svn path=/trunk/; revision=2554
Diffstat (limited to 'externals')
-rw-r--r--externals/grill/py/py.vcproj8
-rw-r--r--externals/grill/py/source/main.cpp10
-rw-r--r--externals/grill/py/source/main.h9
3 files changed, 19 insertions, 8 deletions
diff --git a/externals/grill/py/py.vcproj b/externals/grill/py/py.vcproj
index 50640b5b..7c006dfe 100644
--- a/externals/grill/py/py.vcproj
+++ b/externals/grill/py/py.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="c:\programme\audio\pd\src;f:\prog\max\flext\source;C:\Programme\prog\Python23\include"
+ AdditionalIncludeDirectories="c:\programme\audio\pd\src;..\flext\source;C:\Programme\prog\Python24\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PY_EXPORTS;FLEXT_SYS=2"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
@@ -40,7 +40,7 @@
OutputFile=".\pd-msvc\d/py.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="c:/programme/audio/pd/bin;&quot;..\flext\pd-msvc&quot;;&quot;F:\prog\packs\Python-2.3.2\PCbuild&quot;"
+ AdditionalLibraryDirectories="c:/programme/audio/pd/bin;&quot;c:\data\prog\packs\Python-2.4\PCbuild&quot;"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\pd-msvc\d/py.pdb"
ImportLibrary=".\pd-msvc\d/py.lib"
@@ -85,7 +85,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="&quot;c:\data\prog\pd\pd-cvs\src&quot;;c:\data\pdmax\flext\source;&quot;C:\data\prog\packs\Python-2.4\include&quot;;&quot;C:\data\prog\packs\Python-2.4\PC&quot;"
+ AdditionalIncludeDirectories="&quot;c:\data\prog\pd\pd-cvs\src&quot;;..\flext\source;c:\programme\prog\Python24\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PY_EXPORTS;FLEXT_SYS=2;FLEXT_THREADS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -105,7 +105,7 @@
OutputFile="$(outdir)/py.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="&quot;c:/data/prog/pd/pd-cvs/bin&quot;;&quot;c:\data\prog\packs\Python-2.4\PCbuild&quot;"
+ AdditionalLibraryDirectories="&quot;C:\data\prog\packs\Python-2.4\PCbuild&quot;;&quot;c:/data/prog/pd/pd-cvs/bin&quot;"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(outdir)/py.pdb"
SubSystem="2"
diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp
index 33200c8b..89696b46 100644
--- a/externals/grill/py/source/main.cpp
+++ b/externals/grill/py/source/main.cpp
@@ -158,13 +158,17 @@ py::py():
FLEXT_ADDTIMER(stoptmr,tick);
+#ifdef FLEXT_THREADS
// launch thread worker
FLEXT_CALLMETHOD(threadworker);
+#endif
}
py::~py()
{
shouldexit = true;
+
+#ifdef FLEXT_THREADS
qucond.Signal();
if(thrcount) {
@@ -176,7 +180,7 @@ py::~py()
while(thrcount) Sleep(0.01f);
post("%s - Okay, all threads have terminated",thisName());
}
-
+#endif
PyThreadState *state = PyLock();
Py_XDECREF(module_obj);
PyUnlock(state);
@@ -456,10 +460,12 @@ bool py::gencall(PyObject *pmeth,PyObject *pargs)
Py_DECREF(pargs);
Py_DECREF(pmeth);
break;
+#ifdef FLEXT_THREADS
case 1:
// put call into queue
ret = qucall(pmeth,pargs);
break;
+#endif
case 2:
// each call a new thread
if(!shouldexit) {
@@ -491,6 +497,7 @@ void py::work_wrapper(void *data)
--thrcount;
}
+#ifdef FLEXT_THREADS
bool py::qucall(PyObject *fun,PyObject *args)
{
if(qufifo.Push(fun,args)) {
@@ -526,6 +533,7 @@ void py::threadworker()
PyUnlock(state);
}
+#endif
#if FLEXT_SYS == FLEXT_SYS_MAX
short py::patcher_myvol(t_patcher *x)
diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h
index ef9a16c9..8671a87f 100644
--- a/externals/grill/py/source/main.h
+++ b/externals/grill/py/source/main.h
@@ -133,14 +133,15 @@ protected:
#endif
private:
+
+ void work_wrapper(void *data);
+
+#ifdef FLEXT_THREADS
bool qucall(PyObject *fun,PyObject *args);
void threadworker();
Fifo qufifo;
ThrCond qucond;
- void work_wrapper(void *data);
-
-#ifdef FLEXT_THREADS
FLEXT_THREAD_X(work_wrapper)
#else
FLEXT_CALLBACK_X(work_wrapper)
@@ -194,7 +195,9 @@ protected:
FLEXT_CALLBACK(m_doc)
FLEXT_CALLBACK_T(tick)
+#ifdef FLEXT_THREADS
FLEXT_THREAD(threadworker)
+#endif
};
#endif