On Mar 9, 2:50 pm, "abcd" <[EMAIL PROTECTED]> wrote:
> I guess this might be overkill then...
>
> class MyList(list):
>     def __init__(self):
>         self.l = threading.Lock()
>
>     def append(self, val):
>         try:
>             self.l.acquire()
>             list.append(self, val)
>         finally:
>             if self.l.locked():
>                 self.l.release()
>
> ....performing the same locking/unlocking for the other methods (i.e.
> remove, extend, etc).

comments?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to