You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2005/09/13 19:59:48 UTC
svn commit: r280609 - in /httpd/mod_python/trunk: src/mod_python.c
test/test.py
Author: grisha
Date: Tue Sep 13 10:59:44 2005
New Revision: 280609
URL: http://svn.apache.org/viewcvs?rev=280609&view=rev
Log:
FreeBSD passes all tests now
Modified:
httpd/mod_python/trunk/src/mod_python.c
httpd/mod_python/trunk/test/test.py
Modified: httpd/mod_python/trunk/src/mod_python.c
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/mod_python.c?rev=280609&r1=280608&r2=280609&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/mod_python.c (original)
+++ httpd/mod_python/trunk/src/mod_python.c Tue Sep 13 10:59:44 2005
@@ -31,7 +31,7 @@
* (In a Python dictionary) */
static PyObject * interpreters = NULL;
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef APR_HAS_THREAD
static apr_thread_mutex_t* interpreters_lock = 0;
#endif
@@ -40,7 +40,7 @@
/**
** make_interpreter
**
- * Creates a new Python interpeter.
+ * Creates a new Python interpreter.
*/
static PyInterpreterState *make_interpreter(const char *name, server_rec *srv)
@@ -129,9 +129,8 @@
if (! name)
name = MAIN_INTERPRETER;
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef APR_HAS_THREAD
apr_thread_mutex_lock(interpreters_lock);
- PyEval_AcquireLock();
#endif
if (!interpreters) {
@@ -158,8 +157,7 @@
idata = (interpreterdata *)PyCObject_AsVoidPtr(p);
}
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
- PyEval_ReleaseLock();
+#ifdef APR_HAS_THREAD
apr_thread_mutex_unlock(interpreters_lock);
#endif
@@ -171,7 +169,7 @@
/* create thread state and acquire lock */
tstate = PyThreadState_New(idata->istate);
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_AcquireThread(tstate);
#else
PyThreadState_Swap(tstate);
@@ -183,7 +181,7 @@
if (!idata->obcallback)
{
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_ReleaseThread(tstate);
#endif
PyThreadState_Delete(tstate);
@@ -207,7 +205,7 @@
static void release_interpreter(void)
{
PyThreadState *tstate = PyThreadState_Get();
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_ReleaseThread(tstate);
#endif
PyThreadState_Delete(tstate);
@@ -515,8 +513,12 @@
/* initialze the interpreter */
Py_Initialize();
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
- apr_thread_mutex_create(&interpreters_lock,APR_THREAD_MUTEX_UNNESTED,p);
+#ifdef APR_HAS_THREAD
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, s, "just before");
+ apr_thread_mutex_create(&interpreters_lock, APR_THREAD_MUTEX_UNNESTED, p);
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, s, "just after");
+#endif
+#ifdef WITH_THREAD
/* create and acquire the interpreter lock */
PyEval_InitThreads();
#endif
@@ -532,7 +534,7 @@
exit(1);
}
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
/* release the lock; now other threads can run */
PyEval_ReleaseLock();
#endif
@@ -1790,7 +1792,7 @@
Py_Finalize();
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_ReleaseLock();
#endif
@@ -1815,11 +1817,11 @@
/* accordig Py C Docs we must do this after forking */
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_AcquireLock();
#endif
PyOS_AfterFork();
-#if MOD_PYTHON_WITH_THREAD_SUPPORT
+#ifdef WITH_THREAD
PyEval_ReleaseLock();
#endif
Modified: httpd/mod_python/trunk/test/test.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/test/test.py?rev=280609&r1=280608&r2=280609&view=diff
==============================================================================
--- httpd/mod_python/trunk/test/test.py (original)
+++ httpd/mod_python/trunk/test/test.py Tue Sep 13 10:59:44 2005
@@ -121,6 +121,7 @@
import urllib
import httplib
import os
+import sys
import shutil
import time
import socket
@@ -188,6 +189,11 @@
# where other modules might be
modpath = LIBEXECDIR
+ if sys.platform != 'win32':
+ lockfile = LockFile("logs/accept.lock")
+ else:
+ lockfile = ''
+
s = Container(
IfModule("prefork.c",
StartServers("3"),
@@ -221,7 +227,7 @@
LogLevel("debug"),
LogFormat(r'"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined'),
CustomLog("logs/access_log combined"),
- # LockFile("logs/accept.lock"),
+ lockfile,
TypesConfig("conf/mime.types"),
PidFile("logs/httpd.pid"),
ServerName("127.0.0.1"),