...

[Jim Jewett]
>> qsize, empty, and full could be done with a lockself decorator.
>> Effectively, they *are* lockself decorators for the _xxx functions
>> that subclasses are told to override.

[Guido] 
> Actually you're pointing out a bug in the Queue module: these *should*
> be using a try/finally clause to ensure the mutex is released even if
> the inner call raises an exception.

Yup!  OTOH, if those dead-simple methods raised an exception, the
Queue has probably gone wholly insane anyway.

> I hadn't noticed these before because I was scanning only for "finally"
>
> If a locking primitive had been available, I'm sure it would have been
> used here.

That too.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to