thread.allocate_lock

Piers Lauder piers at cs.su.oz.au
Wed Jul 18 18:57:08 EDT 2001


I'm having problems with threading.

My program occasionally gets errors of the form:

	Unhandled exception in thread:
	Traceback (innermost last):
	  File "/var/tmp/python-root/usr/lib/python1.5/threading.py", line 392, in __bootstrap
	  File "/var/tmp/python-root/usr/lib/python1.5/threading.py", line 401, in __delete
	AttributeError: 'None' object has no attribute 'acquire'


The line 401 in threading.py says:
        _active_limbo_lock.acquire()

At line 20 _active_limbo_lock is set as follows:
	_allocate_lock = thread.allocate_lock

So the only way I can see that it could become None, is if allocate_lock()
can return None.

Is this possible (without an exception perhaps) eg: when OS resources
are exhausted?

If so, line 20 needs a small change.

Anyone else seen this problem before?

PS: I've checked the 2.1 source, and it doesn't appear materially
different when handling  _active_limbo_lock.


________________________________________________________________________________
Computer Science, Sydney University, Madsen Bldg F09, Sydney NSW 2006, Australia
Phone: +61 2 9351 2824    Fax: +61 2 9351 3838     http://www.cs.su.oz.au/~piers








More information about the Python-list mailing list