Apache Mod-Python - Re: FreeBSD compile problem (was Getting ready for 3.2 beta 2)

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > September 2005 > Re: FreeBSD compile problem (was Getting ready for 3.2 beta 2)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: FreeBSD compile problem (was Getting ready for 3.2 beta 2)
Jim Gallacher

2005-09-13, 2:46 am

-1 for this patch. Actually, the patch itself is fine - it just doesn't
fix the problem. The unit tests are still failings as per my previous
messages. ie the following is getting logged in test/logs/error_log:

[Mon Sep 12 19:49:33 2005] [emerg] (2)No such file or directory:
Couldn't create accept lock

Jim

Gregory (Grisha) Trubetskoy wrote:
>
> Here's a patch (this is against 3.1.2b). Untested. This replaces GIL
> with with the APR lock.
>
> --- src/mod_python.c.orig Mon Sep 12 16:42:28 2005
> +++ src/mod_python.c Mon Sep 12 17:32:26 2005
> @@ -31,7 +31,9 @@
> * (In a Python dictionary) */
> static PyObject * interpreters = NULL;
>
> +#ifdef APR_HAS_THREAD
> static apr_thread_mutex_t* interpreters_lock = 0;
> +#endif
>
> apr_pool_t *child_init_pool = NULL;
>
> @@ -127,9 +129,8 @@
> if (! name)
> name = MAIN_INTERPRETER;
>
> -#ifdef WITH_THREAD
> +#ifdef APR_HAS_THREAD
> apr_thread_mutex_lock(interpreters_lock)
;
> - PyEval_AcquireLock();
> #endif
>
> if (!interpreters) {
> @@ -156,8 +157,7 @@
> idata = (interpreterdata *)PyCObject_AsVoidPtr(p);
> }
>
> -#ifdef WITH_THREAD
> - PyEval_ReleaseLock();
> +#ifdef APR_HAS_THREAD
> apr_thread_mutex_unlock(interpreters_loc
k);
> #endif
>
> @@ -513,8 +513,10 @@
> /* initialze the interpreter */
> Py_Initialize();
>
> -#ifdef WITH_THREAD
> +#ifdef APR_HAS_THREAD
>
> apr_thread_mutex_create(& interpreters_lock,APR_THREAD_MUTEX_UNNES
TED,p);
> +#endif
> +#ifdef WITH_THREAD
> /* create and acquire the interpreter lock */
> PyEval_InitThreads();
> #endif
>
>
>
>
> On Mon, 12 Sep 2005, Gregory (Grisha) Trubetskoy wrote:
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com