- Zope-1.9.0 + Python-1.5.2b1 = BOOM
When compiling, I get: ./../Components/ExtensionClass/ThreadLock.c:75: parse error before `type_lock' Apparently this is due to a renaming in Python between 1.5.1 and 1.5.2b1: thread.h -> pythread.h (which the code does look for) but apparently there has now been a renaming of type_lock -> PyThread_type_lock (also type_sema -> PyThread_type_sema) and free_lock -> PyThread_free_lock. I'm guessing the first change came with the 1.5.2a series and the latter came with 1.5.2b; 1.5.2b1's pythread.h definitely does not have all the renaming stuff in 1.5.1. Luckily I still had a 1.5.1 source tree lying around. Making the changes above SHOULD work for 1.5.1 as well, however, since it does do a bunch of renaming in thread.h, but if you're using 1.5.1, you probably don't need the patch. Patch attached. -- Andy Dustman You should always say "spam" and "eggs" ComStar Communications Corp. instead of "foo" and "bar" (706) 549-7689 | PGP KeyID=0xC72F3F1D in Python examples. (Mark Lutz) --- Zope-1.9.0-src/lib/Components/ExtensionClass/ThreadLock.c.orig Tue Nov 17 16:43:50 1998 +++ Zope-1.9.0-src/lib/Components/ExtensionClass/ThreadLock.c Thu Dec 24 16:41:23 1998 @@ -72,7 +72,7 @@ int count; long id; #ifdef WITH_THREAD - type_lock lock; + PyThread_type_lock lock; #endif } ThreadLockObject; @@ -82,7 +82,7 @@ cacquire(ThreadLockObject *self) { #ifdef WITH_THREAD - long id = get_thread_ident(); + long id = PyThread_get_thread_ident(); #else long id = 1; #endif @@ -99,7 +99,7 @@ { #ifdef WITH_THREAD Py_BEGIN_ALLOW_THREADS - acquire_lock(self->lock, 1); + PyThread_acquire_lock(self->lock, 1); Py_END_ALLOW_THREADS #endif self->count=0; @@ -120,7 +120,7 @@ crelease(ThreadLockObject *self) { #ifdef WITH_THREAD - long id = get_thread_ident(); + long id = PyThread_get_thread_ident(); #else long id = 1; #endif @@ -133,7 +133,7 @@ one. */ self->count--; #ifdef WITH_THREAD - if(self->count < 0) release_lock(self->lock); + if(self->count < 0) PyThread_release_lock(self->lock); #endif } else @@ -187,7 +187,7 @@ ThreadLock_dealloc(ThreadLockObject *self) { #ifdef WITH_THREAD - free_lock(self->lock); + PyThread_free_lock(self->lock); #endif PyMem_DEL(self); } @@ -248,7 +248,7 @@ UNLESS(self = PyObject_NEW(ThreadLockObject, &ThreadLockType)) return NULL; self->count=-1; #ifdef WITH_THREAD - self->lock = allocate_lock(); + self->lock = PyThread_allocate_lock(); if (self->lock == NULL) { PyMem_DEL(self); self = NULL; @@ -262,7 +262,7 @@ ident(PyObject *self, PyObject *args) { #ifdef WITH_THREAD - return PyInt_FromLong(get_thread_ident()); + return PyInt_FromLong(PyThread_get_thread_ident()); #else return PyInt_FromLong(0); #endif
participants (1)
-
Andy Dustman