[Python-checkins] python/dist/src/Lib Queue.py,1.16,1.17
Bjorn Pettersen
BPettersen@NAREX.com
2002年10月16日 10:45:55 -0600
> From: Guido van Rossum [mailto:guido@python.org]=20
>=20
> > > Hm, I wonder if the threading module should make this
> > > operation (wait for a lock with a timeout) available natively.
> > >=20
> > > Then on some platforms maybe the lock implementation can
> > > support this natively and we can get rid of the silly=20
> sleeps there.
> >=20
> > The locks in Queue.py are created using thread.allocate_lock(). The=20
> > aquire on the resulting lock takes an optional timeout... (I'm=20
> > assuming that's portable..? -- at least it works on windows <wink>)
>=20
> No, the optional argument on acquire() is not a timeout. =20
> It's a block/noblock flag.
Argh. You're right. In my defense I converted this to C++ before I ran
into the problem ;-)
-- bjorn